VirtualFileSystem { public static String getLast(String path) { String toReturn = path.substring(path.lastIndexOf(separator) + 1); if (toReturn.equals("")) { return separator; } return toReturn; } private  VirtualFileSystem(); static String getLast(String path); static VirtualFileSystem getVirtualFileSystem(); static String stripLast(String path); static String fixPath(String path); static final String dirName; static final String fileSystemPath; static final String separator; }
@Test public void testGetLast() { assertEquals(VirtualFileSystem.getLast("/full/path/to/file"), "file"); assertEquals(VirtualFileSystem.getLast("/full/path/to"), "to"); }