void (@NotNull LoadingState state) { LoadingState old = currentState.getAndSet(state); if (old.compareTo(state) > 0) { BiConsumer<String, Throwable> errorHandler = LoadingState.errorHandler; if (errorHandler != null) { errorHandler.accept("New state " + state + " cannot precede old " + old, new Throwable()); } } }