code: private ICredentialRepository getValidCredentialRepository()
      {
          ICredentialRepository repository = getCredentialRepository();
  
          if (repository == null)
          {
              throw new UnsupportedOperationException(
                      String.format("An instance of the %s service must be " +
                                      "configured in order to use this feature.",
                              ICredentialRepository.class.getName()
                      )
              );
          }
  
          return repository;
      }
docs: This method loads the first available and valid ICredentialRepository
  registered using the Java service loader API.
  
  @return the first registered ICredentialRepository.
  @throws java.lang.UnsupportedOperationException if no valid service is
  found.