### Question:
Lexer { Token next() { if (!hasNextChar()) { return new Token(Type.EOF, currentLineNumber); } char c = getChar(); while (Character.isWhitespace(c)) { if(c == '\n') { currentLineNumber++; } if (!hasNextChar()) { return new Token(Type.EOF, currentLineNumber); } c = getChar(); } if (c == '#') { while (c != '\n') { c = getChar(); } currentLineNumber++; return next(); } if (c == '"') { return nextString(); } if (c == ':') { return new Token(Type.COLON, currentLineNumber); } unputChar(); Token token = nextIdentifier(); switch (token.getValue().toLowerCase()) { case "category": return new Token(Type.CATEGORY, currentLineNumber); case "attribute": return new Token(Type.ATTRIBUTE, currentLineNumber); case "object": return new Token(Type.OBJECT, currentLineNumber); case "name": return new Token(Type.NAME, currentLineNumber); case "data_type": return new Token(Type.DATA_TYPE, currentLineNumber); case "of": return new Token(Type.OF, currentLineNumber); case "end": return new Token(Type.END, currentLineNumber); case "dictionary": return new Token(Type.DICTIONARY, currentLineNumber); case "owner": return new Token(Type.OWNER, currentLineNumber); case "target": return new Token(Type.TARGET, currentLineNumber); case "relation": return new Token(Type.RELATION, currentLineNumber); case "relations": return new Token(Type.RELATIONS, currentLineNumber); } return token; } Lexer(String input);   }### Answer:
@Test public void testNext() throws Exception { StringBuffer buffer = new StringBuffer(); System.out.println(); try (FileReader in = new FileReader(LexerTest.class.getResource("computer.conf").getFile())) { try (BufferedReader bin = new BufferedReader(in)) { String line; while ((line = bin.readLine()) != null) { buffer.append(line).append("\n"); } } } System.out.println(buffer); Lexer l = new Lexer(buffer.toString()); while (true) { Token token = l.next(); System.out.println(token); if (token.getType() == Type.EOF) { break; } } }