test_class.file: singa-mathematics/src/test/java/bio/singa/mathematics/combinatorics/StreamCombinationsTest.java
test_class.identifier: StreamCombinationsTest
test_case.body: @Test
      @DisplayName("combinations - combinations of different sizes")
      void testCombinationStream() {
          List<String> list = new ArrayList<>();
          list.add("A");
          list.add("B");
          list.add("C");
  
          List<List<String>> size1Combinations = StreamCombinations.combinations(1, list).collect(Collectors.toList());
          assertTrue(size1Combinations.contains(Collections.singletonList("A")));
          assertTrue(size1Combinations.contains(Collections.singletonList("B")));
          assertTrue(size1Combinations.contains(Collections.singletonList("C")));
          assertEquals(3, size1Combinations.size());
  
          List<List<String>> size2Combinations = StreamCombinations.combinations(2, list).collect(Collectors.toList());
          List<String> ab = new ArrayList<>();
          ab.add("A");
          ab.add("B");
          assertTrue(size2Combinations.contains(ab));
          List<String> ac = new ArrayList<>();
          ac.add("A");
          ac.add("C");
          assertTrue(size2Combinations.contains(ac));
          List<String> bc = new ArrayList<>();
          bc.add("B");
          bc.add("C");
          assertTrue(size2Combinations.contains(bc));
          assertEquals(3, size2Combinations.size());
  
          List<List<String>> size3Combinations = StreamCombinations.combinations(3, list).collect(Collectors.toList());
          List<String> abc = new ArrayList<>();
          abc.add("A");
          abc.add("B");
          abc.add("C");
          assertTrue(size3Combinations.contains(abc));
          assertEquals(1, size3Combinations.size());
      }
test_case.class_method_signature: StreamCombinationsTest.testCombinationStream()
test_case.full_signature: @Test @DisplayName("combinations - combinations of different sizes") void testCombinationStream()
test_case.identifier: testCombinationStream
test_case.invocations: add add add collect combinations toList assertTrue contains singletonList assertTrue contains singletonList assertTrue contains singletonList assertEquals size collect combinations toList add add assertTrue contains add add assertTrue contains add add assertTrue contains assertEquals size collect combinations toList add add add assertTrue contains assertEquals size
test_case.modifiers: @Test @DisplayName("combinations - combinations of different sizes")
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCombinationStream()
focal_class.file: singa-mathematics/src/main/java/bio/singa/mathematics/combinatorics/StreamCombinations.java
focal_class.identifier: StreamCombinations
focal_class.class_method_signature: StreamCombinations.StreamCombinations()
focal_class.full_signature: private  StreamCombinations()
focal_class.identifier: StreamCombinations
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  StreamCombinations()
focal_class.class_method_signature: StreamCombinations.combinations(int size, List<T> list)
focal_class.full_signature: public static Stream<List<T>> combinations(int size, List<T> list)
focal_class.identifier: combinations
focal_class.modifiers: public static
focal_class.parameters: (int size, List<T> list)
focal_class.return: Stream<List<T>>
focal_class.signature: Stream<List<T>> combinations(int size, List<T> list)
focal_class.class_method_signature: StreamCombinations.pipe(T head, List<T> tail)
focal_class.full_signature: private static List<T> pipe(T head, List<T> tail)
focal_class.identifier: pipe
focal_class.modifiers: private static
focal_class.parameters: (T head, List<T> tail)
focal_class.return: List<T>
focal_class.signature: List<T> pipe(T head, List<T> tail)
focal_method.body: public static <T> Stream<List<T>> combinations(int size, List<T> list) {
          if (size == 0) {
              return Stream.of(Collections.emptyList());
          } else {
              return IntStream.range(0, list.size())
                      .boxed()
                      .flatMap(i -> combinations(size - 1, list.subList(i + 1, list.size()))
                              .map(t -> pipe(list.get(i), t)));
          }
      }
focal_method.class_method_signature: StreamCombinations.combinations(int size, List<T> list)
focal_method.full_signature: public static Stream<List<T>> combinations(int size, List<T> list)
focal_method.identifier: combinations
focal_method.invocations: of emptyList flatMap boxed range size map combinations subList size pipe get
focal_method.modifiers: public static
focal_method.parameters: (int size, List<T> list)
focal_method.return: Stream<List<T>>
focal_method.signature: Stream<List<T>> combinations(int size, List<T> list)