### Question:
VirtualDataSourceResourceConverter extends ResourceConverterImpl<VirtualReportDataSource, ClientVirtualDataSource> { @Override protected VirtualReportDataSource resourceSpecificFieldsToServer(ClientVirtualDataSource clientObject, VirtualReportDataSource resultToUpdate, List<Exception> exceptions, ToServerConversionOptions options) throws IllegalParameterValueException { final List<ClientSubDataSourceReference> subDataSources = clientObject.getSubDataSources(); Map<String,ResourceReference> dataSourceUriMap = Collections.EMPTY_MAP; if(subDataSources != null && !subDataSources.isEmpty()){ dataSourceUriMap = new HashMap<String, ResourceReference>(subDataSources.size()); for(ClientSubDataSourceReference currentReference : subDataSources){ dataSourceUriMap.put(currentReference.getId(), new ResourceReference(currentReference.getUri())); } } resultToUpdate.setDataSourceUriMap(dataSourceUriMap); return resultToUpdate; }    }### Answer:
@Test public void resourceSpecificFieldsToServer() throws Exception { final String expectedId1 = "testId1"; final String expectedId2 = "testId2"; final String expectedUri1 = "testUri1"; final String expectedUri2 = "testUri2"; ClientVirtualDataSource clientObject = new ClientVirtualDataSource(); VirtualReportDataSource serverObject = new VirtualReportDataSourceImpl(); List<ClientSubDataSourceReference> subDataSourceReferences = new ArrayList<ClientSubDataSourceReference>(); ClientSubDataSourceReference reference = new ClientSubDataSourceReference(); reference.setId(expectedId1); reference.setUri(expectedUri1); subDataSourceReferences.add(reference); reference = new ClientSubDataSourceReference(); reference.setId(expectedId2); reference.setUri(expectedUri2); subDataSourceReferences.add(reference); clientObject.setSubDataSources(subDataSourceReferences); final VirtualReportDataSource result = converter.resourceSpecificFieldsToServer(clientObject, serverObject, new ArrayList<Exception>(), null); assertSame(result, serverObject); final Map<String,ResourceReference> dataSourceUriMap = result.getDataSourceUriMap(); assertNotNull(dataSourceUriMap); assertEquals(dataSourceUriMap.size(), 2); assertTrue(dataSourceUriMap.containsKey(expectedId1)); assertTrue(dataSourceUriMap.containsKey(expectedId2)); assertEquals(dataSourceUriMap.get(expectedId1).getReferenceURI(), expectedUri1); assertEquals(dataSourceUriMap.get(expectedId2).getReferenceURI(), expectedUri2); }