@Override public boolean excludeGroup(ILdapEntry groupEntry,String groupObjectSid){
  if (WELL_KNOWN_GROUP_SIDS.contains(groupObjectSid))   return true;
  if (groupEntry == null)   return false;
  int groupTypes=ServerUtils.getIntegerValue(groupEntry.getAttributeValues(ATTR_GROUP_TYPE));
  String groupDomain=ServerUtils.getDomainFromDN(groupEntry.getDN());
  if (((groupTypes & DOMAIN_LOCAL_GROUP_TYPE) != 0) && (groupDomain != null) && (joinedDomain != null)&& (!groupDomain.equalsIgnoreCase(joinedDomain)))   return true;
  if ((groupTypes & SECURITY_GROUP_TYPE) == 0)   return true;
  return false;
}

@ Override public boolean excludeGroup ( ILdapEntry groupEntry , String groupObjectSid ) { if ( WELL_KNOWN_GROUP_SIDS . contains ( groupObjectSid ) ) return true ; if ( groupEntry == null ) return false ; int groupTypes = ServerUtils . getIntegerValue ( groupEntry . getAttributeValues ( ATTR_GROUP_TYPE ) ) ; String groupDomain = ServerUtils . getDomainFromDN ( groupEntry . getDN ( ) ) ; if ( ( ( groupTypes & DOMAIN_LOCAL_GROUP_TYPE ) != 0 ) && ( groupDomain != null ) && ( joinedDomain != null ) && ( ! groupDomain . equalsIgnoreCase ( joinedDomain ) ) ) return true ; if ( ( groupTypes & SECURITY_GROUP_TYPE ) == 0 ) return true ; return false ; }
exclude well known groups , domain local groups and distribution groups
