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)); }