示例#1
0
  @Test
  public void test_construction_permutations() {
    for (int a = 0; a < 6; a++) {
      compare_order(newSet(a), setOf(a));
      for (int b = 0; b < 6; b++) {
        compare_order(newSet(a, b), setOf(a, b));
        for (int c = 0; c < 6; c++) {
          compare_order(newSet(a, b, c), setOf(a, b, c));
          for (int d = 0; d < 6; d++) {
            compare_order(newSet(a, b, c, d), setOf(a, b, c, d));
            for (int e = 0; e < 6; e++) {
              compare_order(newSet(a, b, c, d, e), setOf(a, b, c, d, e));
              for (int f = 0; f < 6; f++) {
                Integer[] elements = new Integer[] {a, b, c, d, e, f};
                Set<Integer> expected = newSet(elements);
                Collection<Integer> collection = Arrays.asList(elements);

                // setOf
                compare_order(expected, setOf(a, b, c, d, e, f));
                // asSet(array)
                compare_order(expected, asSet(elements));
                // asSet(collection)
                compare_order(expected, asSet(collection));
                // asSet(iterator)
                compare_order(expected, asSet(collection.iterator()));
              }
            }
          }
        }
      }
    }
  }
示例#2
0
 @Test
 public void test_publicInterfaceRef_annotation_present() {
   Collection<Integer> elements = new ArrayList<>();
   for (int i = 0; i < 15; i++) {
     assertSame(
         BasicConstSet.class,
         asSet(elements).getClass().getAnnotation(PublicInterfaceRef.class).value());
     elements.add(i);
   }
 }