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) {
  }
}

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 ) { } }
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 .
