### Question:
GenericValidatingPackager extends GenericPackager implements ISOValidator { protected void setGenericPackagerParams ( Attributes atts ) { String maxField = atts.getValue( "maxValidField" ); String emitBmap = atts.getValue( "emitBitmap" ); String bmapfield = atts.getValue( "bitmapField" ); if ( maxField != null ) maxValidField = Integer.parseInt( maxField ); if ( emitBmap != null ) emitBitmap = Boolean.valueOf(emitBmap); if ( bmapfield != null ) bitmapField = Integer.parseInt( bmapfield ); } GenericValidatingPackager(  );  GenericValidatingPackager( String fileName );  GenericValidatingPackager(InputStream stream); void readFile(String filename); void setMsgValidator( ISOBaseValidator[] msgVlds ); void setFieldValidator( ISOFieldValidator[] fvlds ); ISOComponent validate(ISOComponent m);  }### Answer:
@Test public void testSetGenericPackagerParams() throws Throwable { Attributes atts = new AttributesImpl(); GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager(); genericValidatingPackager.setGenericPackagerParams(atts); assertEquals(1, genericValidatingPackager.bitmapField, "genericValidatingPackager.bitmapField"); assertEquals(128, genericValidatingPackager.maxValidField, "genericValidatingPackager.maxValidField"); assertTrue(genericValidatingPackager.emitBitmap, "genericValidatingPackager.emitBitmap"); assertEquals(0, atts.getLength(), "(AttributesImpl) atts.getLength()"); }
@Test public void testSetGenericPackagerParamsThrowsNullPointerException() throws Throwable { GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager(); try { genericValidatingPackager.setGenericPackagerParams(null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.xml.sax.Attributes.getValue(String)\" because \"atts\" is null", ex.getMessage(), "ex.getMessage()"); } assertEquals(1, genericValidatingPackager.bitmapField, "genericValidatingPackager.bitmapField"); assertEquals(128, genericValidatingPackager.maxValidField, "genericValidatingPackager.maxValidField"); assertTrue(genericValidatingPackager.emitBitmap, "genericValidatingPackager.emitBitmap"); } }