SuffixedCatalogMapper implements CatalogMapper { @Override public Catalog toCatalog(Catalog catalog) { return new Catalog(catalog.getServiceDefinitions() .stream() .map(this::toSuffixedServiceDefinition) .collect(Collectors.toList())); } SuffixedCatalogMapper(String serviceOfferingSuffix); @Override Catalog toCatalog(Catalog catalog);  }
@Test public void should_get_catalog_with_prefixed_service_offering() { SuffixedCatalogMapper mapper = new SuffixedCatalogMapper("-suffix"); Catalog input = catalog(); final Catalog prefixedCatalog = mapper.toCatalog(input); Assert.assertEquals(expectedCatalog(), prefixedCatalog); }