RemoteFile extends File { @Override public long lastModified() { return lastModified; } private  RemoteFile(String filepath); @Override long length(); @Override boolean setLastModified(long time); @Override long lastModified(); @Override boolean isFile(); @Override boolean isDirectory();  }
@Test public void testLastModified() { RemoteFile f = new RemoteFile.Builder().setPath("hello").build(); assertEquals(-1, f.lastModified()); long now = System.currentTimeMillis(); assertEquals(now, new RemoteFile.Builder().setPath("hello").setLastModified(now).build().lastModified()); }