public boolean implies(Permission p){
  if (!(p instanceof DiscoveryPermission))   return false;
  String grp=p.getName();
  String group=getName();
  if (group.startsWith("*")) {
    if (group.length() == 1)     return true;
    if (grp.length() == 1)     return false;
    return (grp.length() >= group.length() && group.regionMatches(false,2,grp,grp.length() - group.length() + 2,group.length() - 2));
  }
  if (grp.startsWith("*"))   return false;
  return group.equals(grp);
}

public boolean implies ( Permission p ) { if ( ! ( p instanceof DiscoveryPermission ) ) return false ; String grp = p . getName ( ) ; String group = getName ( ) ; if ( group . startsWith ( "*" ) ) { if ( group . length ( ) == 1 ) return true ; if ( grp . length ( ) == 1 ) return false ; return ( grp . length ( ) >= group . length ( ) && group . regionMatches ( false , 2 , grp , grp . length ( ) - group . length ( ) + 2 , group . length ( ) - 2 ) ) ; } if ( grp . startsWith ( "*" ) ) return false ; return group . equals ( grp ) ; }
returns true if the name of this permission ( the one on which the method is invoked ) is the same as the name of the permission parameter , or if the name of this permission starts with ' * ' and the remainder ( after the ' * ' ) is a suffix of the name of the permission parameter .
