### Question:
NquadsUdParser extends NQuadsParser { @Override public synchronized void parse(Reader reader, String baseUri) throws IOException, RDFParseException, RDFHandlerException { if (reader == null) { throw new IllegalArgumentException("Reader can not be 'null'"); } if (baseUri == null) { throw new IllegalArgumentException("base URI can not be 'null'"); } if (rdfHandler != null) { rdfHandler.startRDF(); } this.reader = new PushbackReader(reader); lineNo = 1; reportLocation(lineNo, 1); try { int character = readCodePoint(); while (character != -1) { if (character == '#' || character == ' ' || character == '@' || character == '\\') { character = skipLine(character); } else if (character == '+' || character == '-') { int action = character; character = readCodePoint(); if (character == '<' || character == '_') { actions.push(action); } else { character = skipLine(character); } } else if (character == '\r' || character == '\n') { character = skipLine(character); } else { character = parseQuad(character); } } } finally { clear(); } if (rdfHandler != null) { rdfHandler.endRDF(); } } NquadsUdParser(); @Override synchronized void parse(Reader reader, String baseUri); @Override RDFParser setRDFHandler(RDFHandler handler); @Override RDFFormat getRDFFormat();  }### Answer:
@Test public void itAdds() throws Exception { StringReader reader = new StringReader("+<http: instance.parse(reader, "http: verify(rdfProcessor).onQuad( true, "http: "http: "12", "http: null, "http: ); }
@Test public void itIgnoresLinesThatStartWithoutAPlusOrAMinus() throws Exception { StringReader reader = new StringReader( " <http: "@@ -1,4 +1,4 @@" ); instance.parse(reader, "http: verify(rdfProcessor, never()).onQuad( anyBoolean(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString() ); }
@Test public void itIgnoresLinesThatStartWithTriplePlusSigns() throws Exception { StringReader reader = new StringReader("+++ fruits2\t2017-08-16 11:38:05.327645535 +0200"); instance.parse(reader, "http: verify(rdfProcessor, never()).onQuad( anyBoolean(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString() ); }
@Test public void itIgnoresLinesThatStartWithTripleMinusSigns() throws Exception { StringReader reader = new StringReader("--- fruits1\t2017-08-16 11:37:47.247741827 +0200"); instance.parse(reader, "http: verify(rdfProcessor, never()).onQuad( anyBoolean(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString() ); }
@Test public void itIgnoresLinesThatStartWithABackslash() throws Exception { StringReader reader = new StringReader("\\ No newline at end of file"); instance.parse(reader, BASE_URI); verify(rdfProcessor, never()).onQuad( anyBoolean(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString() ); }