### Question:
OSMXMLReader extends StaxStreamReader { public void moveTo(final Long id) throws XMLStreamException{ moveToId = id; read(); moveToId = -1; }  @Override void setInput(final Object input); Envelope getEnvelope(); void moveTo(final Long id); boolean hasNext(); Object next();  }### Answer:
@Test public void testMoveTo() throws FileNotFoundException, XMLStreamException, IOException, ParseException { File testFile = new File("src/test/resources/org/geotoolkit/test-data/osm/sampleOSM.osm"); OSMXMLReader reader = new OSMXMLReader(); reader.setInput(testFile); Envelope env = reader.getEnvelope(); assertNotNull(env); assertTrue(Utilities.equalsIgnoreMetadata(env.getCoordinateReferenceSystem(), CommonCRS.WGS84.normalizedGeographic())); assertEquals(-0.108157396316528d, env.getMinimum(0),DELTA); assertEquals(-0.107599496841431d, env.getMaximum(0),DELTA); assertEquals(51.5073601795557d, env.getMinimum(1),DELTA); assertEquals(51.5076406454029d, env.getMaximum(1),DELTA); reader.moveTo(27776903l); final List<Object> elements = new ArrayList<>(); while(reader.hasNext()){ elements.add(reader.next()); } reader.dispose(); final Feature way = (Feature) elements.get(0); final Feature rel = (Feature) elements.get(1); Feature user = (Feature) way.getPropertyValue("user"); List<Feature> tags = (List) way.getPropertyValue("tags"); List<Long> nodes = (List) way.getPropertyValue("nd"); assertEquals(27776903l, way.getPropertyValue("id")); assertEquals(1368552, way.getPropertyValue("changeset")); assertEquals(3, way.getPropertyValue("version")); assertEquals(70, user.getPropertyValue("uid")); assertEquals("Matt", user.getPropertyValue("user")); assertEquals(TemporalUtilities.parseDate("2009-05-31T13:39:15Z").getTime(), way.getPropertyValue("timestamp")); assertEquals(2, tags.size()); assertEquals("access",tags.get(0).getPropertyValue("k")); assertEquals("private",tags.get(0).getPropertyValue("v")); assertEquals("highway",tags.get(1).getPropertyValue("k")); assertEquals("service",tags.get(1).getPropertyValue("v")); assertEquals(2, nodes.size()); assertEquals(319408586, nodes.get(0).longValue()); assertEquals(275452090, nodes.get(1).longValue()); user = (Feature) rel.getPropertyValue("user"); tags = (List) rel.getPropertyValue("tags"); List<Feature> members = (List) rel.getPropertyValue("members"); assertEquals(33368911l, rel.getPropertyValue("id")); assertEquals(152, rel.getPropertyValue("changeset")); assertEquals(3, rel.getPropertyValue("version")); assertEquals(77, user.getPropertyValue("uid")); assertEquals("Georges", user.getPropertyValue("user")); assertEquals(TemporalUtilities.parseDate("2009-05-31T13:39:15Z").getTime(), rel.getPropertyValue("timestamp")); assertEquals(1, tags.size()); assertEquals("space",tags.get(0).getPropertyValue("k")); assertEquals("garden",tags.get(0).getPropertyValue("v")); assertEquals(2, members.size()); assertEquals(27776903l, members.get(0).getPropertyValue("ref")); assertEquals("border", members.get(0).getPropertyValue("role")); assertEquals(MemberType.WAY, members.get(0).getPropertyValue("type")); assertEquals(319408586l, members.get(1).getPropertyValue("ref")); assertEquals("center", members.get(1).getPropertyValue("role")); assertEquals(MemberType.NODE, members.get(1).getPropertyValue("type")); }