ErrorHandlerBuilder implements DataSetReadyCallback { @Override public boolean onError(final ClientRuntimeError error) { setEmptyResults(); errorCallback.error(error.getThrowable()); GWT.log("DataSet with UUID [ " + UUID + " ] error: ", error.getThrowable()); return false; }  @Inject void setErrorCallback(DefaultWorkbenchErrorCallback errorCallback); void setCallback(Consumer<DataSet> callback); void setUUID(String UUID); void setEmptyResultsCallback(Command emptyResultsCallback); ErrorHandlerBuilder withEmptyResultsCallback(final Command command); ErrorHandlerBuilder withUUID(final String UUID); ErrorHandlerBuilder withDataSetCallback(final Consumer<DataSet> dataSetCallback); @Override void notFound(); void showErrorMessage(final String message); @Override boolean onError(final ClientRuntimeError error); @Override void callback(final DataSet dataSet);  }
@Test public void testOnError() { final Command command = mock(Command.class); dataSetReadyCallback.setEmptyResultsCallback(command); dataSetReadyCallback.onError(mock(ClientRuntimeError.class)); verify(command).execute(); verify(errorCallback).error(any()); verify(dataSetReadyCallback, never()).showErrorMessage(any()); }