public function equals(PrincipalInterface $another)
    {

        // query whether or not another principal has been passed
        if ($another instanceof PrincipalInterface) {
            $anotherName = $another->getName();
            $equals = false;
            if ($this->name == null) {
                $equals = $anotherName == null;
            } else {
                $equals = $this->name->equals($anotherName);
            }

            // return the flag if the both are equal
            return $equals;
        }

        // return FALSE if they are not equal
        return false;
    }