Promise<Void> (@NotNull Object service) { ServiceViewItem item = myRef.get(); return item == null || !item.getValue().equals(service) ? Promises.rejectedPromise("Service not found") : Promises.resolvedPromise(); }