### Question:
OSMMaxAxleLoadParser implements TagParser { @Override public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) { OSMValueExtractor.extractTons(edgeFlags, way, maxAxleLoadEncoder, Collections.singletonList("maxaxleload")); return edgeFlags; } OSMMaxAxleLoadParser();  OSMMaxAxleLoadParser(DecimalEncodedValue maxAxleLoadEncoder); @Override void createEncodedValues(EncodedValueLookup lookup, List<EncodedValue> registerNewEncodedValue); @Override IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags);  }### Answer:
@Test public void testSimpleTags() { ReaderWay readerWay = new ReaderWay(1); IntsRef intsRef = em.createEdgeFlags(); readerWay.setTag("maxaxleload", "11.5"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(11.5, malEnc.getDecimal(false, intsRef), .01); intsRef = em.createEdgeFlags(); readerWay.setTag("maxaxleload", "80"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(malEnc.getMaxDecimal(), malEnc.getDecimal(false, intsRef), .01); }
@Test public void testRounding() { ReaderWay readerWay = new ReaderWay(1); IntsRef intsRef = em.createEdgeFlags(); readerWay.setTag("maxaxleload", "4.8"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(5.0, malEnc.getDecimal(false, intsRef), .01); intsRef = em.createEdgeFlags(); readerWay.setTag("maxaxleload", "3.6"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(3.5, malEnc.getDecimal(false, intsRef), .01); intsRef = em.createEdgeFlags(); readerWay.setTag("maxaxleload", "2.4"); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(2.5, malEnc.getDecimal(false, intsRef), .01); }
@Test public void testNoLimit() { ReaderWay readerWay = new ReaderWay(1); IntsRef intsRef = em.createEdgeFlags(); parser.handleWayTags(intsRef, readerWay, false, relFlags); assertEquals(Double.POSITIVE_INFINITY, malEnc.getDecimal(false, intsRef), .01); }