TreeParser { public static Tree parseTree(Path path) throws IOException { Tree.Builder builder = Tree.Builder.aTreeBuilder(); Files.lines(path) .forEach(line -> builder.withRow(parseLine(line))); return builder.build(); }  static Tree parseTree(Path path);  }
@Test public void it_builds_a_tree_from_a_file() throws Exception{ Assertions.assertThat( Tree.Builder.aTreeBuilder() .withRow(Lists.newArrayList(3)) .withRow(Lists.newArrayList(7, 4)) .withRow(Lists.newArrayList(2, 4, 6)) .withRow(Lists.newArrayList(8, 5, 9, 3)).build()).isEqualTo( TreeParser.parseTree(Paths.get(ClassLoader.getSystemResource("SmallTree.txt").toURI()))); }