Promise<Object> (@NotNull XValue value) { //noinspection unchecked final V v = (V)value; M m = myProvider.getMarker(v); if (m != null) { return myProvider.unmarkValueAsync(v, m) .onSuccess(__ -> myMarkers.remove(m)); } else { return Promises.resolvedPromise(); } }