@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ShipMovement that = (ShipMovement) o; if (movements != null ? !movements.equals(that.movements) : that.movements != null) return false; if (ship != null ? !ship.equals(that.ship) : that.ship != null) return false; return true; }