### Question:
RelativeFile { @Override public boolean equals(Object obj) { if (!(obj instanceof RelativeFile)) { return false; } RelativeFile other = (RelativeFile) obj; return Objects.equal(base, other.base) && Objects.equal(relativePath, other.relativePath) && Objects.equal(type, other.type); } RelativeFile(@NonNull File base, @NonNull File file);  RelativeFile(@NonNull File base, @NonNull String relativePath);  RelativeFile(@NonNull File base, @NonNull String relativePath, @NonNull Type type); @NonNull File getBase(); @NonNull String getRelativePath(); @NonNull Type getType(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @NonNull final Type type; }### Answer:
@Test public void relativeFileNotEqualsIfDifferentFile() throws Exception { File base = temporaryFolder.newFolder("base"); File relative = new File(base, "relative"); RelativeFile rf1 = new RelativeFile(base, relative); RelativeFile rf2 = new RelativeFile(base, new File("relative2")); assertFalse(rf1.equals(rf2)); }
@Test public void relativeFileNotEqualsIfDifferentBase() throws Exception { File base = temporaryFolder.newFolder("base"); File relative = new File(base, "relative"); RelativeFile rf1 = new RelativeFile(base, relative); File base2 = temporaryFolder.newFolder("base2"); RelativeFile rf2 = new RelativeFile(base2, new File(base2, "relative")); assertFalse(rf1.equals(rf2)); }