CompositeMetadata implements Iterable<Entry> { public Stream<Entry> stream() { return StreamSupport.stream( Spliterators.spliteratorUnknownSize( iterator(), Spliterator.DISTINCT | Spliterator.NONNULL | Spliterator.ORDERED), false); } CompositeMetadata(ByteBuf source, boolean retainSlices); Stream<Entry> stream(); @Override Iterator<Entry> iterator();  }
@Test void streamIsNotParallel() { final CompositeMetadata metadata = new CompositeMetadata(ByteBufUtils.getRandomByteBuf(5), false); assertThat(metadata.stream().isParallel()).as("isParallel").isFalse(); }
@Test void streamSpliteratorCharacteristics() { final CompositeMetadata metadata = new CompositeMetadata(ByteBufUtils.getRandomByteBuf(5), false); assertThat(metadata.stream().spliterator()) .matches(s -> s.hasCharacteristics(Spliterator.ORDERED), "ORDERED") .matches(s -> s.hasCharacteristics(Spliterator.DISTINCT), "DISTINCT") .matches(s -> s.hasCharacteristics(Spliterator.NONNULL), "NONNULL") .matches(s -> !s.hasCharacteristics(Spliterator.SIZED), "not SIZED"); }