### Question:
AbstractClientDiagramService implements ClientDiagramService<M, D, S> { @Override public void add(final D diagram, final ServiceCallback<D> callback) { diagramServiceCaller.call(v -> { updateClientMetadata(diagram); callback.onSuccess(diagram); }, (message, throwable) -> { callback.onError(new ClientRuntimeError(throwable)); return false; }).saveOrUpdate(diagram); } AbstractClientDiagramService(final ShapeManager shapeManager,
                                        final SessionManager sessionManager,
                                        final Caller<S> diagramServiceCaller,
                                        final Caller<DiagramLookupService> diagramLookupServiceCaller,
                                        final Event<SessionDiagramSavedEvent> saveEvent); @Override void create(final Path path,
                       final String name,
                       final String defSetId,
                       final ServiceCallback<Path> callback); @Override @SuppressWarnings("unchecked") void saveOrUpdate(final D diagram,
                             final ServiceCallback<D> callback); @Override void saveOrUpdateSvg(Path diagramPath, String rawSvg, ServiceCallback<Path> callback); @Override void add(final D diagram,
                    final ServiceCallback<D> callback); @Override @SuppressWarnings("unchecked") void getByPath(final Path path,
                          final ServiceCallback<D> callback); @Override @SuppressWarnings("unchecked") void lookup(final DiagramLookupRequest request,
                       final ServiceCallback<LookupManager.LookupResponse<DiagramRepresentation>> callback); @Override void getRawContent(final D diagram,
                              final ServiceCallback<String> callback);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testAdd() { final ServiceCallback<D> callback = mock(ServiceCallback.class); tested.add(diagram, callback); verify(diagramService, times(1)).saveOrUpdate(eq(diagram)); verify(callback, times(1)).onSuccess(eq(diagram)); verify(callback, times(0)).onError(any(ClientRuntimeError.class)); }