### Question:
OrgFile extends OrgNode { public static OrgFile createFromFile(final OrgParser parser, final File file) throws IOException, ParseException { return createFromBufferedReader(parser, file.getName(), new BufferedReader(new FileReader(file))); } OrgFile(final OrgParser orgParser, final String fname); static OrgFile createFromBufferedReader(final OrgParser parser, final String filename,
                                                   final BufferedReader br); static OrgFile createFromString(final OrgParser parser, final String filename, final String content); static OrgFile createFromFile(final OrgParser parser, final File file); static OrgFile createFromFile(final OrgParser parser, final String filepath); long lastModified(); String getFilename(); void setFilename(final String filename); void writeToBuffer(final BufferedWriter bw); boolean delete(); boolean delete(final String filename); boolean rename(final String newFilename);  }### Answer:
@Test public void testfile() throws Exception { final OrgFile root = OrgFile.createFromFile(new RegexParser(), getFile(TESTFILEPATH)); print("\n\n"); print(root.treeToString()); OrgNode leaf = root; while (leaf != null) { print(leaf.getAllTags()); if (leaf.getSubNodes().isEmpty()) { leaf = null; } else { leaf = leaf.getSubNodes().get(0); } } writeToFile(File.createTempFile("test-out", ".org"), root); }