### Question:
OSMHazmatParser implements TagParser { @Override public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) { if (readerWay.hasTag("hazmat", "no")) { hazEnc.setEnum(false, edgeFlags, Hazmat.NO); } return edgeFlags; } OSMHazmatParser(); @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", "no"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(Hazmat.NO, hazEnc.getEnum(false, intsRef)); intsRef = em.createEdgeFlags(); readerWay.setTag("hazmat", "yes"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef)); intsRef = em.createEdgeFlags(); readerWay.setTag("hazmat", "designated"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef)); intsRef = em.createEdgeFlags(); readerWay.setTag("hazmat", "designated"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef)); }
@Test public void testNoNPE() { ReaderWay readerWay = new ReaderWay(1); IntsRef intsRef = em.createEdgeFlags(); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef)); }