### Question:
TsvParser { private static Optional<Node> parseNode(String nodeString) { try { return Optional.of(NodeFactoryExtra.parseNode(nodeString)); } catch (RiotException e) { log.error("Parsing of value '{}' failed: {}", nodeString, e.getMessage()); return Optional.empty(); } } TsvParser(BufferedReader in); Map<String, Node> getTuple();  }### Answer:
@Test public void testResourceEnding() throws IOException { Map<String, Node> result = parseSingleTuple("?s\n" + "<http: assertEquals(NodeFactoryExtra.parseNode("<http: }
@Test public void testEmptyVariablesInResult() throws IOException { Map<String, Node> result = parseSingleTuple("?s\t?p\t?o\n" + "<http: assertEquals(NodeFactoryExtra.parseNode("<http: assertFalse(result.containsKey("p")); assertEquals(NodeFactoryExtra.parseNode("\"o2\""), result.get("o")); }
@Test public void testMultipleEmptyVariablesInResult() throws IOException { Map<String, Node> result; result = parseSingleTuple("?s\t?p\t?o\n" + "\t\t\"o2\"\n"); assertFalse(result.containsKey("s")); assertFalse(result.containsKey("p")); assertEquals(NodeFactoryExtra.parseNode("\"o2\""), result.get("o")); result = parseSingleTuple("?s\t?p\t?o\n" + "<http: assertEquals(NodeFactoryExtra.parseNode("<http: assertFalse(result.containsKey("p")); assertFalse(result.containsKey("o")); result = parseSingleTuple("?s\t?p\t?o\n" + "\t\t\t\n"); assertEquals(0, result.size()); }
@Test public void testNodeParser() { Node parseNode = NodeFactoryExtra.parseNode("\"Hallo \\\"Echo\\\"!\"@de"); assertEquals("de", parseNode.getLiteralLanguage()); assertEquals("Hallo \"Echo\"!", parseNode.getLiteralValue()); }