So it color seems to color be a class and therefore a reference type, which means you need to use equals()colors to compare.
if ( this.color.equals(other.color)) {
As noted in the comments, using ==reference types to compare really compares memory addresses in Java. It will only return trueif they both refer to the same object in memory.
akf, Object , Object.equals(), , .. . , (, , , false).
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Ghost))
return false;
Ghost other = (Ghost) obj;
return this.x == other.x
&& this.y == other.y
&& this.direction == other.direction
&& this.color.equals(other.color);
}