public static <T> void registerLater(MeterRegistry registry, MeterIdPrefix idPrefix, Class<T> type,
                                         BiFunction<MeterRegistry, MeterIdPrefix, T> factory) {

        final RegistrationState registrationState = MicrometerUtil.registrationState.get();
        if (!registrationState.isRegistering) {
            register(registry, idPrefix, type, factory);
        } else {
            registrationState.pendingRegistrations.add(
                    new PendingRegistration<>(registry, idPrefix, type, factory));
        }
    }
Similar to {@link #register(MeterRegistry, MeterIdPrefix, Class, BiFunction)}, but used when
a registration has to be nested, because otherwise the registration may enter an infinite loop,
as described <a href="https://bugs.openjdk.java.net/browse/JDK-8062841">here</a>. For example:
<pre>{@code
// OK
register(registry, idPrefix, type, (r, i) -> {
    registerLater(registry, anotherIdPrefix, anotherType, ...);
    return ...;
});

// Not OK
register(registry, idPrefix, type, (r, i) -> {
    register(registry, anotherIdPrefix, anotherType, ...);
    return ...;
});
}</pre>
core/src/main/java/com/linecorp/armeria/internal/common/metric/MicrometerUtil.java