test_class.file: common/src/test/java/com/scottlogic/datahelix/generator/common/whitelist/DistributedListTest.java
test_class.identifier: DistributedListTest
test_case.body: @Test
      public void testWeightedOrDefaultPassesThroughWeightedElements() {
          WeightedElement<String> firstManual = new WeightedElement<>("first", 0.2);
          WeightedElement<String> secondManual = new WeightedElement<>("second", 0.3);
          WeightedElement<String> thirdManual = new WeightedElement<>("third", 0.5);
  
          WeightedElement<String> first = new WeightedElement<>("first", 2);
          WeightedElement<String> second = new WeightedElement<>("second", 3);
          WeightedElement<String> third = new WeightedElement<>("third", 5);
  
          List<WeightedElement<String>> manualElements = Arrays.asList(
              firstManual,
              secondManual,
              thirdManual
          );
          DistributedList<String> manualSet = new DistributedList<>(manualElements);
  
          List<WeightedElement<String>> elements = Arrays.asList(first, second, third);
          DistributedList<WeightedElement<String>> weightedSet = DistributedList.weightedOrDefault(elements);
  
          assertEquals(manualSet, weightedSet);
      }
test_case.class_method_signature: DistributedListTest.testWeightedOrDefaultPassesThroughWeightedElements()
test_case.full_signature: @Test public void testWeightedOrDefaultPassesThroughWeightedElements()
test_case.identifier: testWeightedOrDefaultPassesThroughWeightedElements
test_case.invocations: asList asList weightedOrDefault assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWeightedOrDefaultPassesThroughWeightedElements()
focal_class.declarator: EMPTY = new DistributedList<>(Collections.emptyList())
focal_class.modifier: private static final
focal_class.original_string: private static final DistributedList<?> EMPTY = new DistributedList<>(Collections.emptyList());
focal_class.type: DistributedList<?>
focal_class.var_name: EMPTY
focal_class.declarator: underlyingWeights
focal_class.modifier: private final
focal_class.original_string: private final List<WeightedElement<T>> underlyingWeights;
focal_class.type: List<WeightedElement<T>>
focal_class.var_name: underlyingWeights
focal_class.declarator: underlyingCumulativeWeights
focal_class.modifier: private final
focal_class.original_string: private final List<WeightedElement<T>> underlyingCumulativeWeights;
focal_class.type: List<WeightedElement<T>>
focal_class.var_name: underlyingCumulativeWeights
focal_class.file: common/src/main/java/com/scottlogic/datahelix/generator/common/whitelist/DistributedList.java
focal_class.identifier: DistributedList
focal_class.class_method_signature: DistributedList.DistributedList(final List<WeightedElement<T>> underlyingWeights)
focal_class.full_signature: public  DistributedList(final List<WeightedElement<T>> underlyingWeights)
focal_class.identifier: DistributedList
focal_class.modifiers: public
focal_class.parameters: (final List<WeightedElement<T>> underlyingWeights)
focal_class.signature:  DistributedList(final List<WeightedElement<T>> underlyingWeights)
focal_class.class_method_signature: DistributedList.normalise(final List<WeightedElement<T>> denormalised)
focal_class.full_signature: private static List<WeightedElement<T>> normalise(final List<WeightedElement<T>> denormalised)
focal_class.identifier: normalise
focal_class.modifiers: private static
focal_class.parameters: (final List<WeightedElement<T>> denormalised)
focal_class.return: List<WeightedElement<T>>
focal_class.signature: List<WeightedElement<T>> normalise(final List<WeightedElement<T>> denormalised)
focal_class.class_method_signature: DistributedList.singleton(final T element)
focal_class.full_signature: public static DistributedList<T> singleton(final T element)
focal_class.identifier: singleton
focal_class.modifiers: public static
focal_class.parameters: (final T element)
focal_class.return: DistributedList<T>
focal_class.signature: DistributedList<T> singleton(final T element)
focal_class.class_method_signature: DistributedList.weightedOrDefault(final Collection<T> underlyingSet)
focal_class.full_signature: public static DistributedList<T> weightedOrDefault(final Collection<T> underlyingSet)
focal_class.identifier: weightedOrDefault
focal_class.modifiers: public static
focal_class.parameters: (final Collection<T> underlyingSet)
focal_class.return: DistributedList<T>
focal_class.signature: DistributedList<T> weightedOrDefault(final Collection<T> underlyingSet)
focal_class.class_method_signature: DistributedList.uniform(final Collection<T> underlyingSet)
focal_class.full_signature: public static DistributedList<T> uniform(final Collection<T> underlyingSet)
focal_class.identifier: uniform
focal_class.modifiers: public static
focal_class.parameters: (final Collection<T> underlyingSet)
focal_class.return: DistributedList<T>
focal_class.signature: DistributedList<T> uniform(final Collection<T> underlyingSet)
focal_class.class_method_signature: DistributedList.cumulative(List<WeightedElement<T>> nonCumulative)
focal_class.full_signature: private static List<WeightedElement<T>> cumulative(List<WeightedElement<T>> nonCumulative)
focal_class.identifier: cumulative
focal_class.modifiers: private static
focal_class.parameters: (List<WeightedElement<T>> nonCumulative)
focal_class.return: List<WeightedElement<T>>
focal_class.signature: List<WeightedElement<T>> cumulative(List<WeightedElement<T>> nonCumulative)
focal_class.class_method_signature: DistributedList.replaceLastCumulativeElement(List<WeightedElement<T>> cumulative)
focal_class.full_signature: private static void replaceLastCumulativeElement(List<WeightedElement<T>> cumulative)
focal_class.identifier: replaceLastCumulativeElement
focal_class.modifiers: private static
focal_class.parameters: (List<WeightedElement<T>> cumulative)
focal_class.return: void
focal_class.signature: void replaceLastCumulativeElement(List<WeightedElement<T>> cumulative)
focal_class.class_method_signature: DistributedList.empty()
focal_class.full_signature: @SuppressWarnings("unchecked") public static DistributedList<T> empty()
focal_class.identifier: empty
focal_class.modifiers: @SuppressWarnings("unchecked") public static
focal_class.parameters: ()
focal_class.return: DistributedList<T>
focal_class.signature: DistributedList<T> empty()
focal_class.class_method_signature: DistributedList.distributedList()
focal_class.full_signature: public List<WeightedElement<T>> distributedList()
focal_class.identifier: distributedList
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<WeightedElement<T>>
focal_class.signature: List<WeightedElement<T>> distributedList()
focal_class.class_method_signature: DistributedList.pickRandomly(RandomNumberGenerator random)
focal_class.full_signature: public T pickRandomly(RandomNumberGenerator random)
focal_class.identifier: pickRandomly
focal_class.modifiers: public
focal_class.parameters: (RandomNumberGenerator random)
focal_class.return: T
focal_class.signature: T pickRandomly(RandomNumberGenerator random)
focal_class.class_method_signature: DistributedList.getElementFromCumulativeDistribution(final double value)
focal_class.full_signature: private T getElementFromCumulativeDistribution(final double value)
focal_class.identifier: getElementFromCumulativeDistribution
focal_class.modifiers: private
focal_class.parameters: (final double value)
focal_class.return: T
focal_class.signature: T getElementFromCumulativeDistribution(final double value)
focal_class.class_method_signature: DistributedList.binarySearch(List<Double> weights, double target)
focal_class.full_signature: private static int binarySearch(List<Double> weights, double target)
focal_class.identifier: binarySearch
focal_class.modifiers: private static
focal_class.parameters: (List<Double> weights, double target)
focal_class.return: int
focal_class.signature: int binarySearch(List<Double> weights, double target)
focal_class.class_method_signature: DistributedList.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: DistributedList.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: DistributedList.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: DistributedList.stream()
focal_class.full_signature: public Stream<T> stream()
focal_class.identifier: stream
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Stream<T>
focal_class.signature: Stream<T> stream()
focal_class.class_method_signature: DistributedList.list()
focal_class.full_signature: public List<T> list()
focal_class.identifier: list
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<T>
focal_class.signature: List<T> list()
focal_class.class_method_signature: DistributedList.isEmpty()
focal_class.full_signature: public boolean isEmpty()
focal_class.identifier: isEmpty
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmpty()
focal_method.body: public static <T> DistributedList<T> weightedOrDefault(final Collection<T> underlyingSet) {
          return new DistributedList<>(
              underlyingSet.stream()
                  .map(element -> element instanceof WeightedElement
                          ? (WeightedElement<T>) element
                          : WeightedElement.withDefaultWeight(element)
                  )
                  .collect(Collectors.toList()));
      }
focal_method.class_method_signature: DistributedList.weightedOrDefault(final Collection<T> underlyingSet)
focal_method.full_signature: public static DistributedList<T> weightedOrDefault(final Collection<T> underlyingSet)
focal_method.identifier: weightedOrDefault
focal_method.invocations: collect map stream withDefaultWeight toList
focal_method.modifiers: public static
focal_method.parameters: (final Collection<T> underlyingSet)
focal_method.return: DistributedList<T>
focal_method.signature: DistributedList<T> weightedOrDefault(final Collection<T> underlyingSet)