### Question:
ChangesetContentsScanner { public Iterator<Change> parse(InputStream changesetDownloadStream) throws XMLStreamException { final XMLStreamReader reader; reader = XMLInputFactory.newFactory().createXMLStreamReader(changesetDownloadStream, "UTF-8"); reader.nextTag(); reader.require(START_ELEMENT, null, "osmChange"); Iterator<Change> iterator = new AbstractIterator<Change>() { @Override protected Change computeNext() { Change next; try { if (findNextChange(reader)) { next = parseChange(reader); } else { return super.endOfData(); } } catch (XMLStreamException e) { System.err.println("Error parsing change, ignoring and continuing " + "with next change if possible. " + e.getMessage()); next = computeNext(); } return next; } }; return iterator; }  Iterator<Change> parse(InputStream changesetDownloadStream);  }### Answer:
@Test public void testChange1100() throws XMLStreamException { Iterator<Change> iterator = parse("1100/download.xml"); ArrayList<Change> list = Lists.newArrayList(iterator); assertEquals(100, list.size()); }
@Test public void testChange1624() throws XMLStreamException { Iterator<Change> iterator = parse("1624/download.xml"); ArrayList<Change> list = Lists.newArrayList(iterator); assertEquals(4, list.size()); assertEquals(create, list.get(0).getType()); assertEquals(modify, list.get(1).getType()); assertEquals(modify, list.get(2).getType()); assertEquals(delete, list.get(3).getType()); assertTrue(list.get(0).getNode().isPresent()); assertTrue(list.get(1).getNode().isPresent()); assertTrue(list.get(2).getNode().isPresent()); assertTrue(list.get(3).getNode().isPresent()); }
@Test public void testChange1864() throws XMLStreamException { Iterator<Change> iterator = parse("1864/download.xml"); ArrayList<Change> list = Lists.newArrayList(iterator); assertEquals(22, list.size()); assertEquals(create, list.get(0).getType()); assertEquals(create, list.get(1).getType()); assertEquals(modify, list.get(2).getType()); assertEquals(delete, list.get(3).getType()); assertTrue(list.get(0).getRelation().isPresent()); assertTrue(list.get(1).getRelation().isPresent()); assertTrue(list.get(2).getRelation().isPresent()); assertTrue(list.get(3).getWay().isPresent()); assertTrue(list.get(4).getNode().isPresent()); }