@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Juncao other = (Juncao) obj; if (retanguloA == null) { if (other.retanguloA != null) return false; } else if (!retanguloA.equals(other.retanguloA)) return false; if (retanguloB == null) { if (other.retanguloB != null) return false; } else if (!retanguloB.equals(other.retanguloB)) return false; return true; }