code: public static <T> T findSingletonAmongst(Class<T> clazz, Collection<?> instances) {
      return findOptionalAmongst(clazz, instances)
        .orElse(null);
    }
docs: Find the only expected instance of {@code clazz} among the {@code instances}.
  
  @param clazz searched class
  @param instances instances looked at
  @param <T> type of the searched instance
  @return the compatible instance or null if none are found
  @throws IllegalArgumentException if more than one matching instance