### Question:
RadixTree { public RadixNode<T> getLastNodeInPrefixPath(String path) { List<RadixNode<T>> lpp = getLongestPrefixPath(path); Path p = Paths.get(path); if (lpp.size() != p.getNameCount() + 1) { return null; } else { return lpp.get(p.getNameCount()); } } RadixTree(); boolean isEmpty(); void insert(String path); void insert(String path, T val); RadixNode<T> getLastNodeInPrefixPath(String path); void removePrefixPath(String path); List<RadixNode<T>> getLongestPrefixPath(String path); @VisibleForTesting /** * Convert radix path to string format for output. * @param path - radix path represented by list of radix nodes. * @return radix path as string separated by "/". * Note: the path will always be normalized with and ending "/". */ static String radixPathToString(List<RadixNode<Integer>> path); String getLongestPrefix(String path);  }### Answer:
@Test public void testGetLastNoeInPrefixPath() { assertEquals(null, ROOT.getLastNodeInPrefixPath("/a/g")); RadixNode<Integer> ln = ROOT.getLastNodeInPrefixPath("/a/b/e/dir1"); assertEquals("dir1", ln.getName()); }