@SuppressWarnings("unchecked")
  private static <T> List<T> fetch(Reader<T> reader) {
    final List<T> result;
    if (reader instanceof SyncReader) {
      result = ((SyncReader<T>) reader).fetch();
    } else if (reader instanceof ReactiveReader) {
      result = Flowable.fromPublisher(((ReactiveReader<T>) reader).fetch()).toList().blockingGet();
    } else if (reader instanceof AsyncReader) {
      result = Futures.getUnchecked(((AsyncReader<T>) reader).fetch().toCompletableFuture());
    } else {
      throw new IllegalArgumentException("Unknown reader " + reader);
    }

    return result;
  }
Generic checker for a {@link org.immutables.criteria.Criterion}
@param <T>
criteria/common/test/org/immutables/criteria/personmodel/CriteriaChecker.java