@Test public void canCreateRootNode() throws DependencyParseException { String stringTree = "Test_NNP"; DependencyTree parsed = DependencyTreeParser.readFromString(stringTree); assertNotNull(parsed); assertEquals(0, parsed.getDependencies().size()); DependencyNode root = parsed.getRoot(); assertEquals("NNP", root.getType()); assertEquals("Test", root.getContent()); }
public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } } }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }  }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }  static DependencyTree readFromString(String text); static DependencyTree readFromFile(String file); static DependencyTree readFromStream(InputStream is); }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }  static DependencyTree readFromString(String text); static DependencyTree readFromFile(String file); static DependencyTree readFromStream(InputStream is);  }