SuffixedServiceInstanceRequestMapper implements ServiceInstanceRequestMapper { protected static String withoutSuffix(String s, String suffix) { return (s.endsWith(suffix) ? s.substring(0, s.length() - suffix.length()) : s); } SuffixedServiceInstanceRequestMapper(String serviceOfferingSuffix); @Override CreateServiceInstanceRequest map(CreateServiceInstanceRequest request); @Override DeleteServiceInstanceRequest map(DeleteServiceInstanceRequest request); @Override UpdateServiceInstanceRequest map(UpdateServiceInstanceRequest request); @Override GetLastServiceOperationRequest map(GetLastServiceOperationRequest request);  }
@Test public void withoutSuffix() { Assert.assertEquals("plan-one-id", SuffixedServiceInstanceRequestMapper.withoutSuffix("plan-one-id-suffix", "-suffix")); }