jdk/test/java/util/Collections/CheckedSetBash.java
author mduigou
Fri, 12 Jul 2013 11:11:30 -0700
changeset 18818 a9ceff754226
parent 5506 202f599c92aa
child 23010 6dadb192ad81
permissions -rw-r--r--
7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set} Reviewed-by: dmocek, martin, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    26
 * @bug     4904067 7129185
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Unit test for Collections.checkedSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * @author  Josh Bloch
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    29
 * @run testng CheckedSetBash
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.*;
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    33
import java.util.function.Supplier;
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    34
import org.testng.annotations.Test;
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    35
import org.testng.annotations.DataProvider;
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    36
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    37
import static org.testng.Assert.fail;
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    38
import static org.testng.Assert.assertTrue;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public class CheckedSetBash {
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    41
    static final int numItr = 100;
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    42
    static final int setSize = 100;
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    43
    static final Random rnd = new Random();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    45
    @Test(dataProvider = "Supplier<Set<Integer>>")
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    46
    public static void testCheckedSet(String description, Supplier<Set<Integer>> supplier) {
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    47
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    48
        Set<Integer> s1 = supplier.get();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    49
        assertTrue(s1.isEmpty());
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    50
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    51
        AddRandoms(s1, setSize);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    53
        Set<Integer> s2 = supplier.get();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    54
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    55
        assertTrue(s2.isEmpty());
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    56
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    57
        AddRandoms(s2, setSize);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    59
        Set<Integer> intersection = clone(s1, supplier);
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    60
        intersection.retainAll(s2);
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    61
        Set<Integer> diff1 = clone(s1, supplier); diff1.removeAll(s2);
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    62
        Set<Integer> diff2 = clone(s2, supplier); diff2.removeAll(s1);
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    63
        Set<Integer> union = clone(s1, supplier); union.addAll(s2);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    65
        if (diff1.removeAll(diff2))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    66
            fail("Set algebra identity 2 failed");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    67
        if (diff1.removeAll(intersection))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    68
            fail("Set algebra identity 3 failed");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    69
        if (diff2.removeAll(diff1))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    70
            fail("Set algebra identity 4 failed");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    71
        if (diff2.removeAll(intersection))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    72
            fail("Set algebra identity 5 failed");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    73
        if (intersection.removeAll(diff1))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    74
            fail("Set algebra identity 6 failed");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    75
        if (intersection.removeAll(diff1))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    76
            fail("Set algebra identity 7 failed");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    78
        intersection.addAll(diff1); intersection.addAll(diff2);
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    79
        if (!intersection.equals(union))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    80
            fail("Set algebra identity 1 failed");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    82
        if (new HashSet(union).hashCode() != union.hashCode())
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    83
            fail("Incorrect hashCode computation.");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    85
        Iterator e = union.iterator();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    86
        while (e.hasNext())
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    87
            if (!intersection.remove(e.next()))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    88
                fail("Couldn't remove element from copy.");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    89
        if (!intersection.isEmpty())
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    90
            fail("Copy nonempty after deleting all elements.");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    92
        e = union.iterator();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    93
        while (e.hasNext()) {
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    94
            Object o = e.next();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    95
            if (!union.contains(o))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    96
                fail("Set doesn't contain one of its elements.");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    97
            e.remove();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    98
            if (union.contains(o))
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
    99
                fail("Set contains element after deletion.");
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   100
        }
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   101
        if (!union.isEmpty())
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   102
            fail("Set nonempty after deleting all elements.");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   104
        s1.clear();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   105
        if (!s1.isEmpty())
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   106
            fail("Set nonempty after clear.");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    // Done inefficiently so as to exercise toArray
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   110
    static <T> Set<T> clone(Set<T> s, Supplier<Set<T>> supplier) {
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   111
        Set<T> clone = supplier.get();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   112
        List<T> arrayList = Arrays.asList((T[]) s.toArray());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        clone.addAll(arrayList);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        if (!s.equals(clone))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            fail("Set not equal to copy.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        if (!s.containsAll(clone))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            fail("Set does not contain copy.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        if (!clone.containsAll(s))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            fail("Copy does not contain set.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        return clone;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    static void AddRandoms(Set s, int n) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        for (int i=0; i<n; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            int r = rnd.nextInt() % n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            Integer e = new Integer(r < 0 ? -r : r);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            int preSize = s.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            boolean prePresent = s.contains(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            boolean added = s.add(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            if (!s.contains(e))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                fail ("Element not present after addition.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            if (added == prePresent)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                fail ("added == alreadyPresent");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            int postSize = s.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            if (added && preSize == postSize)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                fail ("Add returned true, but size didn't change.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            if (!added && preSize != postSize)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                fail ("Add returned false, but size changed.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   143
    @DataProvider(name = "Supplier<Set<Integer>>", parallel = true)
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   144
    public static Iterator<Object[]> navigableSetsProvider() {
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   145
        ArrayList<Object[]> iters = new ArrayList<>(makeCheckedSets());
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   146
        iters.ensureCapacity(numItr * iters.size());
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   147
        for(int each=1; each < numItr; each++) {
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   148
            iters.addAll( makeCheckedSets());
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   149
        }
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   150
        return iters.iterator();
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   151
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
18818
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   153
    public static Collection<Object[]> makeCheckedSets() {
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   154
        return Arrays.asList(
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   155
            new Object[]{"Collections.checkedSet(HashSet)",
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   156
                (Supplier) () -> {return Collections.checkedSet(new HashSet(), Integer.class);}},
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   157
            new Object[]{"Collections.checkedSet(TreeSet(reverseOrder)",
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   158
                (Supplier) () -> {return Collections.checkedSet(new TreeSet(Collections.reverseOrder()), Integer.class);}},
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   159
            new Object[]{"Collections.checkedSet(TreeSet).descendingSet()",
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   160
                (Supplier) () -> {return Collections.checkedSet(new TreeSet().descendingSet(), Integer.class);}},
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   161
            new Object[]{"Collections.checkedNavigableSet(TreeSet)",
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   162
                (Supplier) () -> {return Collections.checkedNavigableSet(new TreeSet(), Integer.class);}},
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   163
            new Object[]{"Collections.checkedNavigableSet(TreeSet(reverseOrder)",
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   164
                (Supplier) () -> {return Collections.checkedNavigableSet(new TreeSet(Collections.reverseOrder()), Integer.class);}},
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   165
            new Object[]{"Collections.checkedNavigableSet().descendingSet()",
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   166
                (Supplier) () -> {return Collections.checkedNavigableSet(new TreeSet().descendingSet(), Integer.class);}}
a9ceff754226 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
mduigou
parents: 5506
diff changeset
   167
            );
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
}