Listener () { Listener proxy = myListeners.getMulticaster(); return new Listener() { private final AtomicBoolean myIsFinished = new AtomicBoolean(false); @Override public void onSdkNameResolved(@NotNull Sdk sdk) { proxy.onSdkNameResolved(sdk); } @Override public void onSdkResolved(@NotNull Sdk sdk) { if (!myIsFinished.compareAndSet(false, true)) return; proxy.onSdkResolved(sdk); } @Override public void onResolveFailed() { if (!myIsFinished.compareAndSet(false, true)) return; proxy.onResolveFailed(); } }; }