@Override
    public boolean equals(Object obj)
    {
        if (obj instanceof Rectangle)
        {
            Rectangle tmp = (Rectangle) obj;
            if (this.getP1().equals(tmp.getP1()) &&
                    this.getP2().equals(tmp.getP2()) &&
                    this.getP3().equals(tmp.getP3()) &&
                    this.getP4().equals(tmp.getP4()))
            {
                return true;
            }
        }
        return false;
    }