UriTransformer { public String fromEbXML(List<String> slotValues) { if (slotValues.size() == 1) { String slotValue = slotValues.get(0); if (slotValue.indexOf('|') == -1) { return slotValue; } } String[] uriParts = new String[10]; for (String slotValue : slotValues) { int separatorIdx = slotValue.indexOf('|'); if (separatorIdx > 0) { int uriIdx = Integer.parseInt(slotValue.substring(0, separatorIdx)); if (uriIdx < 10) { uriParts[uriIdx] = slotValue.substring(separatorIdx + 1); } } } StringBuilder builder = new StringBuilder(); for (String uriPart : uriParts) { if (uriPart != null) { builder.append(uriPart); } } String uri = builder.toString(); return uri.isEmpty() ? null : uri; }  String fromEbXML(List<String> slotValues); String[] toEbXML(String uri);  }
@Test public void testFromEbXMLWithSimpleUri() { String uri = "http: assertEquals(uri, transformer.fromEbXML(Collections.singletonList(uri))); }