Generate { @SafeVarargs public static <T> Gen<T> frequency(Pair<Integer, Gen<T>> mandatory, Pair<Integer, Gen<T>> ... others) { return frequency(FrequencyGen.makeGeneratorList(mandatory, others)); }  static Gen<T> constant(T constant); static Gen<T> constant(Supplier<T> constant); static Gen<T> pickWithNoShrinkPoint(List<T> ts); static Gen<T> pick(List<T> ts); @SafeVarargs static Gen<T> oneOf(Gen<T> mandatory, Gen<T> ... others); @SafeVarargs static Gen<T> frequency(Pair<Integer, Gen<T>> mandatory,
                                         Pair<Integer, Gen<T>> ... others); static Gen<T> frequency(List<Pair<Integer, Gen<T>>> weightedGens); @SafeVarargs static Gen<T> frequencyWithNoShrinkPoint(Pair<Integer, Gen<T>> mandatory,
                                                          Pair<Integer, Gen<T>> ... others); static Gen<T> frequencyWithNoShrinkPoint(List<Pair<Integer, Gen<T>>> weightedGens); static Gen<Integer> range(final int startInclusive,
      final int endInclusive); static Gen<Integer> range(final int startInclusive,
      final int endInclusive, final int shrinkTarget); static Gen<Integer> rangeWithNoShrinkPoint(final int startInclusive,
                                                     final int endInclusive); static Gen<Long> longRange(final long startInclusive,
      final long endInclusive); static Gen<Long> longRange(final long startInclusive,
      final long endInclusive, final long shrinkTarget); static Gen<Byte> bytes(final byte startInclusive,
      final byte endInclusive, final byte shrinkTarget); static Gen<T> enumValues(Class<T> e); static Gen<Boolean> booleans(); static Gen<Character> characters(int startInclusive, int endInclusive); static Gen<int[]> intArrays(Gen<Integer> sizes, Gen<Integer> contents); static Gen<int[][]> intArrays(Gen<Integer> rows, Gen<Integer> cols, Gen<Integer> contents); static Gen<byte[]> byteArrays(Gen<Integer> sizes, Gen<Byte> contents);  }
@Test public void frequencyMustHaveAtLeastOneEntry() { List<Pair<Integer,Gen<Integer>>> emptyList = new ArrayList<>(); Throwable thrown = org.assertj.core.api.Assertions.catchThrowable(() -> Generate.frequency(emptyList)); org.assertj.core.api.Assertions.assertThat(thrown) .isInstanceOf(IllegalArgumentException.class) .hasNoCause() .hasMessage("List of generators must not be empty"); }