void (final String url) { final Ref<Location> locationRef = Ref.create(); ApplicationManager.getApplication().runReadAction(() -> { Location location = myTestLocator.getLocation(url); locationRef.set(location); }); if (locationRef.get() == null) { myTestStorage.removeState(url); } }