code: public <T extends AuthMethod> T getAuth(Class<T> type) throws NexmoUnacceptableAuthException {
          for (AuthMethod availableAuthMethod : this.authList) {
              if (type.isInstance(availableAuthMethod)) {
                  return (T) availableAuthMethod;
              }
          }
          throw new NexmoUnacceptableAuthException(this.authList, new HashSet<>(Arrays.asList(new Class[]{type})));
      }
docs: Obtain an AuthMethod of type T, if one is contained in this collection.
  
  @param type The type of AuthMethod to be located
  @param <T>  The type of AuthMethod which will be returned
  
  @return An AuthMethod subclass matching type
  
  @throws NexmoUnacceptableAuthException if no matching AuthMethod is found.