### Question:
IhsReader { public Observable<Map<String, String>> from(InputStream is, String parentElementName) { return Observable.just(is).lift(new OperatorIhsReader(parentElementName)); }  Observable<Map<String, String>> from(InputStream is, String parentElementName); static Observable<Map<String, String>> fromZip(File file); static Observable<Map<String, Map<String, String>>> fromZipAsMapByImo(File file); static Observable<Map<String, Map<String, String>>> fromZipAsMapByMmsi(File file); static Ship toShip(Map<String, String> values);  }### Answer:
@Test public void testReaderFromInputStream() { IhsReader r = new IhsReader(); Observable<Ship> o = r .from(IhsReaderTest.class.getResourceAsStream("/ShipData.xml"), "ShipData") .map(IhsReader::toShip); Ship ship = o.last().toBlocking().single(); System.out.println(ship); assertEquals("4544107", ship.getImo()); assertEquals("235101211", ship.getMmsi().get()); assertEquals("Miscellaneous", ship.getType2().get()); assertEquals("Other Activities", ship.getType3().get()); assertEquals("Patrol Vessel", ship.getType4().get()); assertEquals("Patrol Vessel", ship.getType5().get()); assertEquals(525, (long) ship.getGrossTonnage().get()); assertEquals("RI", ship.getClassificationSocietyCode().get()); assertEquals("GBI", ship.getFlagCode().get()); assertEquals("0860230", ship.getGroupBeneficialOwnerCompanyCode().get()); assertEquals("GBI", ship.getGroupBeneficialOwnerCountryOfDomicileCode().get()); assertEquals("FIN", ship.getCountryOfBuildCode().get()); assertEquals(2002, (int) ship.getYearOfBuild().get()); assertEquals(1, (int) ship.getMonthOfBuild().get()); assertEquals(1445.0, ship.getDeadweightTonnage().get(), PRECISION); assertEquals("B34H2SQ", ship.getStatCode5().get()); assertEquals(49.7, ship.getLengthOverallMetres().get(), PRECISION); assertEquals(7.5, ship.getBreadthMetres().get(), PRECISION); assertFalse(ship.getDisplacementTonnage().isPresent()); assertEquals(3.7, ship.getDraughtMetres().get(), PRECISION); assertEquals(22.0, ship.getSpeedKnots().get(), PRECISION); assertEquals("2014-01-16T14:47:29.780Z", ship.getLastUpdateTime().get().toString()); assertEquals("PROTECTOR", ship.getName().get()); assertEquals("FIN020050", ship.getShipBuilderCompanyCode().get()); }