### Question:
ResourceReferenceConverter { public ResourceReference toServer(T clientObject,ToServerConversionOptions options) throws IllegalParameterValueException, MandatoryParameterNotFoundException { return toServer(clientObject, null, options); } ResourceReferenceConverter(ResourceConverterProvider resourceConverterProvider,
            RepositoryService repositoryService, PermissionsService permissionsService, RepositoryConfiguration configuration, ClientReferenceRestriction... restriction); ResourceReferenceConverter<T> addReferenceRestriction(ClientReferenceRestriction restriction); @SuppressWarnings("unchecked") T toClient(ResourceReference serverObject, ToClientConversionOptions options); ResourceReference toServer(T clientObject,ToServerConversionOptions options); ResourceReference toServer(T clientObject, ResourceReference resultToUpdate, ToServerConversionOptions options);  }### Answer:
@Test public void toServer_create_noInitialReference() throws Exception { final ClientJdbcDataSource clientObject = new ClientJdbcDataSource(); final ResourceReferenceConverter referenceConverter = mock(ResourceReferenceConverter.class); when(referenceConverter.toServer(clientObject, null)).thenCallRealMethod(); final ResourceReference resourceReference = referenceConverter.toServer(clientObject, null); assertNull(resourceReference); verify(referenceConverter).toServer(clientObject, null); }
@Test public void toServer() throws Exception { final ClientReference reference = new ClientReference(); final ResourceReferenceConverter converterMock = mock(ResourceReferenceConverter.class); when(converterMock.toServer(any(ClientReferenceable.class), isNull(ResourceReference.class), any(ToServerConversionOptions.class))).thenCallRealMethod(); converterMock.toServer(reference, null, options); verify(converterMock).toServerReference(same(reference), isNull(ResourceReference.class), same(options)); final ClientDataType dataType = new ClientDataType(); converterMock.toServer(dataType, null, options); verify(converterMock).toServerLocalResource(same(dataType), isNull(ResourceReference.class), same(options)); final ResourceReference result = converter.toServer(null, null); assertNull(result); }