### Question:
Directory implements Serializable { @Override public int hashCode() { return getFile().hashCode(); } Directory();  Directory(final File directory); static FileFilter getMatchAllFilesFilter(); void create(); File getFile(); File getFile(final File child); File[] listContents(final FileFilter filter); File[] listContents(final FileFilter filter,
                             final boolean includeDirectories,
                             final boolean absolutePaths); void deleteContents(); void delete(); File rebaseFromCWD(final File file); File relativeFile(final File file, final boolean mustBeChild); List<File> rebasePath(final String path); boolean isParentOf(final File file); void copyTo(final Directory target, final boolean incremental); String[] getWarnings(); @Override int hashCode(); @Override boolean equals(final Object o);  }### Answer:
@Test public void testEquality() throws Exception { final Directory d1 = new Directory(getDirectory()); final Directory d2 = new Directory(getDirectory()); final File f = new File(getDirectory(), "comeonpilgrimyouknowhelovesyou"); assertTrue(f.mkdir()); final Directory d3 = new Directory(f); assertEquals(d1, d1); assertEquals(d1, d2); AssertUtilities.assertNotEquals(d2, d3); assertEquals(d1.hashCode(), d1.hashCode()); assertEquals(d1.hashCode(), d2.hashCode()); AssertUtilities.assertNotEquals(d1, null); AssertUtilities.assertNotEquals(d1, f); }