This is my Hole Class
class Hole { public int a; public int b; Hole(int a, int b) { this.a = a; this.b = b; }
So i adding a
You should overide the equals method of the Hole class:
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Hole)) { return false; } Hole other = (Hole) obj; return a == other.a && b == other.b; }