### Question:
TimestampingServiceConverter { public TimestampingService convert(TspType tsp) { TimestampingService timestampingService = new TimestampingService(); timestampingService.setUrl(tsp.getUrl()); timestampingService.setName(tsp.getName()); return timestampingService; }  TimestampingService convert(TspType tsp); List<TimestampingService> convert(Iterable<TspType> tsps); TspType convert(TimestampingService timestampingService);  }### Answer:
@Test public void convertSingleTspType() { TimestampingService timestampingService = timestampingServiceConverter.convert( TestUtils.createTspType(TSA_1_URL, TSA_1_NAME)); assertEquals(TSA_1_URL, timestampingService.getUrl()); assertEquals(TSA_1_NAME, timestampingService.getName()); }
@Test public void convertEmptyTspTypeList() { List<TspType> tspTypes = new ArrayList<>(); List<TimestampingService> timestampingService = timestampingServiceConverter.convert(tspTypes); assertEquals(0, timestampingService.size()); }
@Test public void convertMultipleTspTypes() { List<TspType> tspTypes = new ArrayList<>(Arrays.asList(TestUtils.createTspType( TSA_1_URL, TSA_1_NAME), TestUtils.createTspType(TSA_2_URL, TSA_2_NAME))); List<TimestampingService> timestampingServices = timestampingServiceConverter.convert(tspTypes); assertEquals(2, timestampingServices.size()); }
@Test public void convertSingleTimestampingService() { TspType tspType = timestampingServiceConverter.convert(TestUtils .createTimestampingService(TSA_1_URL, TSA_1_NAME)); assertEquals(TSA_1_URL, tspType.getUrl()); assertEquals(TSA_1_NAME, tspType.getName()); }