RemoteFile extends File { @Override public boolean isDirectory() { return isDirectory; } private  RemoteFile(String filepath); @Override long length(); @Override boolean setLastModified(long time); @Override long lastModified(); @Override boolean isFile(); @Override boolean isDirectory();  }
@Test public void testIsDirectory() { RemoteFile f = new RemoteFile.Builder().setPath("hello").build(); assertFalse(f.isDirectory()); assertTrue(new RemoteFile.Builder().setPath("hello").setIsDirectory(true).build().isDirectory()); }