TripleEncoder { public Triple encodeTriple(Triple t) { Node s = t.getSubject(); Node p = t.getPredicate(); Node o = t.getObject(); Triple nt = null; try { s = encodeUri(s); o = encodeUri(o); nt = new Triple(s, p, o); } catch (URISyntaxException | UnsupportedEncodingException e) { LOGGER.error("Could not encode triple {}", t, e); return t; } return nt; }  Triple encodeTriple(Triple t);  }
@Test public void testEncoding() { TripleEncoder encoder = new TripleEncoder(); for (int i = 0; i < 10; i++) { Assert.assertEquals(listExpectedTriples.get(i), encoder.encodeTriple(listUncodedTriples.get(i))); } }