### Question:
OSMHazmatWaterParser implements TagParser { @Override public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) { if (readerWay.hasTag("hazmat:water", "no")) { hazWaterEnc.setEnum(false, edgeFlags, HazmatWater.NO); } else if (readerWay.hasTag("hazmat:water", "permissive")) { hazWaterEnc.setEnum(false, edgeFlags, HazmatWater.PERMISSIVE); } return edgeFlags; } OSMHazmatWaterParser(); @Override void createEncodedValues(EncodedValueLookup lookup, List<EncodedValue> registerNewEncodedValue); @Override IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags);  }### Answer:
@Test public void testSimpleTags() { ReaderWay readerWay = new ReaderWay(1); IntsRef intsRef = em.createEdgeFlags(); readerWay.setTag("hazmat:water", "no"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(HazmatWater.NO, hazWaterEnc.getEnum(false, intsRef)); intsRef = em.createEdgeFlags(); readerWay.setTag("hazmat:water", "yes"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(HazmatWater.YES, hazWaterEnc.getEnum(false, intsRef)); intsRef = em.createEdgeFlags(); readerWay.setTag("hazmat:water", "permissive"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(HazmatWater.PERMISSIVE, hazWaterEnc.getEnum(false, intsRef)); }
@Test public void testNoNPE() { ReaderWay readerWay = new ReaderWay(1); IntsRef intsRef = em.createEdgeFlags(); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(HazmatWater.YES, hazWaterEnc.getEnum(false, intsRef)); }