use of com.baremaps.osm.change.OsmChangeSpliterator in project baremaps by baremaps.
the class XmlChangeSpliteratorTest method tryAdvance.
@Test
void tryAdvance() throws IOException {
try (InputStream input = DATA_OSC_XML.openStream()) {
Spliterator<Change> spliterator = new OsmChangeSpliterator(input);
spliterator.forEachRemaining(fileBlock -> assertNotNull(fileBlock));
assertFalse(spliterator.tryAdvance(new HoldingConsumer<>()));
}
}
use of com.baremaps.osm.change.OsmChangeSpliterator 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);
}
}
Aggregations