src/main/java/io/github/glytching/junit/extension/random/RandomBeansExtension.java
private Object resolve(Class<?> targetType, Random annotation) {
    if (targetType.isAssignableFrom(List.class) || targetType.isAssignableFrom(Collection.class)) {
      return random
          .objects(annotation.type(), annotation.size(), annotation.excludes())
          .collect(Collectors.toList());
    } else if (targetType.isAssignableFrom(Set.class)) {
      return random
          .objects(annotation.type(), annotation.size(), annotation.excludes())
          .collect(Collectors.toSet());
    } else if (targetType.isAssignableFrom(Stream.class)) {
      return random.objects(annotation.type(), annotation.size(), annotation.excludes());
    } else {
      return random.nextObject(targetType, annotation.excludes());
    }
  }
private Object resolve(Class<?> targetType, Random annotation) {
    if (targetType.isAssignableFrom(List.class) || targetType.isAssignableFrom(Collection.class)) {
      return random
          .objects(annotation.type(), annotation.size(), annotation.excludes())
          .collect(Collectors.toList());
    } else if (targetType.isAssignableFrom(Set.class)) {
      return random
          .objects(annotation.type(), annotation.size(), annotation.excludes())
          .collect(Collectors.toSet());
    } else if (targetType.isAssignableFrom(Stream.class)) {
      return random.objects(annotation.type(), annotation.size(), annotation.excludes());
    } else {
      return random.nextObject(targetType, annotation.excludes());
    }
  }
Maps the 'random requirements' expressed by the given {@code annotation} to invocations on
{@link #random}.

@param targetType the type to be provided
@param annotation an instance of {@link Random} which describes how the user wishes to
configure the 'random generation'
@return a randomly generated instance of {@code targetType}