### Question:
PrinctonReader { public void read() { BufferedReader reader = new BufferedReader(new InputStreamReader(is), 8 * (1 << 10)); int lineNo = 0; try { lineNo++; int nodes = Integer.parseInt(reader.readLine()); lineNo++; int edges = Integer.parseInt(reader.readLine()); for (int i = 0; i < edges; i++) { lineNo++; String line = reader.readLine(); String args[] = line.split(" "); int from = -1; int to = -1; double dist = -1; int counter = 0; for (int j = 0; j < args.length; j++) { if (Helper.isEmpty(args[j])) { continue; } if (counter == 0) { from = Integer.parseInt(args[j]); } else if (counter == 1) { to = Integer.parseInt(args[j]); } else { dist = Double.parseDouble(args[j]); } counter++; } if (counter != 3) { throw new RuntimeException("incorrect read!? from:" + from + ", to:" + to + ", dist:" + dist); } g.edge(from, to, dist, false); } } catch (Exception ex) { throw new RuntimeException("Problem in line " + lineNo, ex); } finally { Helper.close(reader); } } PrinctonReader( Graph graph ); PrinctonReader setStream( InputStream is ); void read();  }### Answer:
@Test public void testRead() { Graph graph = new GraphBuilder(encodingManager).create(); new PrinctonReader(graph).setStream(PrinctonReader.class.getResourceAsStream("tinyEWD.txt")).read(); assertEquals(8, graph.getNodes()); EdgeExplorer explorer = graph.createEdgeExplorer(carOutEdges); assertEquals(2, count(explorer.setBaseNode(0))); assertEquals(3, count(explorer.setBaseNode(6))); }