@Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }

            ObjectPrincipal that = (ObjectPrincipal) o;

            return object.equals(that.object);

        }
Java Principal wrapper around any Shiro Principal object.s
support/jaxrs/src/main/java/org/apache/shiro/web/jaxrs/ShiroSecurityContext.java