use of com.baremaps.stream.AccumulatingConsumer in project baremaps by baremaps.
the class XmlChangeSpliteratorTest method forEachRemaining.
@Test
void forEachRemaining() throws IOException {
try (InputStream input = DATA_OSC_XML.openStream()) {
Spliterator<Change> spliterator = new OsmChangeSpliterator(input);
AccumulatingConsumer<Change> accumulator = new AccumulatingConsumer<>();
spliterator.forEachRemaining(accumulator);
assertEquals(accumulator.values().size(), 7);
assertEquals(accumulator.values().stream().flatMap(change -> change.getEntities().stream()).collect(Collectors.toList()).size(), 51);
}
}
use of com.baremaps.stream.AccumulatingConsumer in project baremaps by baremaps.
the class XmlEntitySpliteratorTest method forEachRemaining.
@Test
void forEachRemaining() throws IOException {
try (InputStream input = DATA_OSM_XML.openStream()) {
Spliterator<Entity> spliterator = new OsmXmlSpliterator(input);
AccumulatingConsumer<Object> accumulator = new AccumulatingConsumer<>();
spliterator.forEachRemaining(accumulator);
assertEquals(12, accumulator.values().size());
}
}
Aggregations