private boolean containsType(final Set<IPermission> permissions, final String soughtType) {

        // Assertions
        if (permissions == null) {
            throw new IllegalArgumentException("Cannot check null set for contents.");
        }
        if (soughtType == null) {
            throw new IllegalArgumentException("Cannot search for type null.");
        }

        boolean rslt = false; // default

        for (IPermission p : permissions) {
            if (soughtType.equals(p.getType())) {
                rslt = true;
            }
        }

        return rslt;
    }
private boolean containsType ( final Set < IPermission > permissions , final String soughtType ) { if ( permissions == null ) { throw new IllegalArgumentException ( "Cannot check null set for contents." ) ; } if ( soughtType == null ) { throw new IllegalArgumentException ( "Cannot search for type null." ) ; } boolean rslt = false ; for ( IPermission p : permissions ) { if ( soughtType . equals ( p . getType ( ) ) ) { rslt = true ; } } return rslt ; }
Returns true if a set of IPermission instances contains a permission of the specified type,
otherwise false. Permissions passed to this method <em>must</em> already be filtered of
inactive (expired) instances.

@return True if the set contains a permission of the sought type, false otherwise
@throws IllegalArgumentException if input set or type is null.