PluginUpdatesService (@NotNull Consumer<? super Collection<IdeaPluginDescriptor>> callback) { PluginUpdatesService service = new PluginUpdatesService(); service.myUpdateCallbacks = Collections.singletonList(callback); synchronized (ourLock) { SERVICES.add(service); if (myPrepared) { callback.accept(myCache); } } return service; }