FileTuple { public long getLastModified() { return Math.max(original.lastModified(), backup.lastModified()); } FileTuple(final File original, final File backup); File getOriginal(); File getBackup(); long getLastModified(); void delete();  }
@Test public void originalYoungerThanBackup() throws IOException { File original = File.createTempFile("junit", null); File backup = File.createTempFile("junit", null); original.setLastModified(2); backup.setLastModified(1); assertThat(new FileTuple(original, backup).getLastModified()).isEqualTo(original.lastModified()); }
@Test public void backupYoungerThanOriginal() throws IOException { File original = File.createTempFile("junit", null); File backup = File.createTempFile("junit", null); original.setLastModified(1); backup.setLastModified(2); assertThat(new FileTuple(original, backup).getLastModified()).isEqualTo(backup.lastModified()); }