java.util.stream.StreamOpFlag Java Examples

The following examples show how to use java.util.stream.StreamOpFlag. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StreamFlagsTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #2
Source File: StreamFlagsTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #3
Source File: StreamFlagsTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #4
Source File: StreamFlagsTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #5
Source File: StreamFlagsTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #6
Source File: StreamFlagsTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #7
Source File: StreamFlagsTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #8
Source File: StreamFlagsTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #9
Source File: StreamFlagsTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #10
Source File: StreamFlagsTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #11
Source File: StreamFlagsTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #12
Source File: StreamFlagsTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}
 
Example #13
Source File: StreamFlagsTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testBaseStreams() {
    Stream<String> arrayList = new ArrayList<String>().stream();
    Stream<String> linkedList = new LinkedList<String>().stream();
    Stream<String> hashSet = new HashSet<String>().stream();
    Stream<String> treeSet = new TreeSet<String>().stream();
    Stream<String> linkedHashSet = new LinkedHashSet<String>().stream();
    Stream<String> repeat = Stream.generate(() -> "");

    assertFlags(OpTestCase.getStreamFlags(arrayList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedList),
                EnumSet.of(ORDERED, SIZED),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(hashSet),
                EnumSet.of(SIZED, DISTINCT),
                EnumSet.of(ORDERED, SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(treeSet),
                EnumSet.of(ORDERED, SIZED, DISTINCT, SORTED),
                EnumSet.of(SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(linkedHashSet),
                EnumSet.of(ORDERED, DISTINCT, SIZED),
                EnumSet.of(SORTED, SHORT_CIRCUIT));
    assertFlags(OpTestCase.getStreamFlags(repeat),
                EnumSet.noneOf(StreamOpFlag.class),
                EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT));
}