@Override public boolean equals(Object obj){ if (obj == null) return false; if (obj == this) return true; if (obj.getClass() != getClass()) return false; Coord a = (Coord)obj; if(a.x == this.x && a.y == this.y){ return true; } else{ return false; } } @Override public int hashCode() { int hash = 1; hash += hash * 17 + this.x; hash += hash * 31 + this.y; return hash; }