question: public void test_addAttributesLjava_util_MapII ( ) { AttributedString as = new AttributedString ( "test" ) ; Map < AttributedCharacterIterator . Attribute , String > whm = new WeakHashMap < AttributedCharacterIterator . Attribute , String > ( ) ; try { whm . put ( new TestAttributedCharacterIteratorAttribute ( "test1" ) , "value1" ) ; whm . put ( new TestAttributedCharacterIteratorAttribute ( "test2" ) , "value2" ) ; whm . put ( new TestAttributedCharacterIteratorAttribute ( "test3" ) , "value3" ) ; as . addAttributes ( whm , 0 , 3 ) ; } catch ( Exception e ) { fail ( "Unexpected exception " + e . toString ( ) ) ; } try { as . addAttributes ( null , 0 , 3 ) ; fail ( "Expected NullPointerException was not thrown" ) ; } catch ( NullPointerException e ) { } try { as . addAttributes ( whm , 0 , 0 ) ; fail ( "Expected IllegalArgumentException was not thrown" ) ; } catch ( IllegalArgumentException e ) { } }
target:  java.text.AttributedString#addAttributes(Map<? extends AttributedCharacterIterator.Attribute,?>, int, int) Tests of method java.text.AttributedString#addAttributes(Map<? extends AttributedCharacterIterator.Attribute,?>, int, int). Case 1: Try to add attributes to AttributesString. Case 2: Try to add null-attributes to AttributesString. Case 3: Try to add attributes to AttributesString using incorrect index.