public static String lastPathEntry(String path) {
    List<String> splits = split(path);
    if (splits.isEmpty()) {
      // empty path. Return ""
      return "";
    } else {
      return splits.get(splits.size() - 1);
    }
  }
@Test
  public void testLastPathEntry() throws Throwable {
    assertEquals("",lastPathEntry("/"));
    assertEquals("",lastPathEntry("//"));
    assertEquals("c",lastPathEntry("/a/b/c"));
    assertEquals("c",lastPathEntry("/a/b/c/"));
  }