/** Returns {@code true} if the specified provider is for the authority. */
 public boolean filter(final Object provider) {
   if (authority == null) {
     // If the user didn't specified an authority name, then the factory to use must
     // be specified explicitly through a hint (e.g. Hints.CRS_AUTHORITY_FACTORY).
     return false;
   }
   return Citations.identifierMatches(((AuthorityFactory) provider).getAuthority(), authority);
 }
 /** Returns the names of all currently registered authorities. */
 public static synchronized Set<String> getAuthorityNames() {
   /*
    * IMPORTANT: Return the same Set instance (unmodifiable) as long as there is no change
    * in the list of registered factories, and create a new instance in case of changes.
    * 'add/removeAuthorityFactory(...)' and 'scanForPlugins()' methods reset 'authorityNames'
    * to null, which will cause the creation of a new Set instance. Some implementations like
    * AllAuthoritiesFactory rely on this behavior as a way to be notified of registration
    * changes for clearing their cache.
    */
   if (authorityNames == null) {
     authorityNames = new LinkedHashSet<String>();
     final Hints hints = EMPTY_HINTS;
     loop:
     for (int i = 0; ; i++) {
       final Set<? extends AuthorityFactory> factories;
       switch (i) {
         case 0:
           factories = getCRSAuthorityFactories(hints);
           break;
         case 1:
           factories = getCSAuthorityFactories(hints);
           break;
         case 2:
           factories = getDatumAuthorityFactories(hints);
           break;
         case 3:
           factories = getCoordinateOperationAuthorityFactories(hints);
           break;
         default:
           break loop;
       }
       for (final AuthorityFactory factory : factories) {
         final Citation authority = factory.getAuthority();
         if (authority != null) {
           authorityNames.add(Citations.getIdentifier(authority));
           for (final Identifier id : authority.getIdentifiers()) {
             authorityNames.add(id.getCode());
           }
         }
       }
     }
     authorityNames = Collections.unmodifiableSet(authorityNames);
   }
   return authorityNames;
 }
 /** Returns {@code true} if the specified provider is built by the vendor. */
 public boolean filter(final Object provider) {
   return Citations.titleMatches(((Factory) provider).getVendor(), vendor);
 }