TreeMap<Integer, CTRPrElt> formats = str.getFormatMap(st);
assertEquals(1, formats.size());
assertEquals(26, (int)formats.firstKey());
assertNull(formats.get( formats.firstKey() ));
CTRPrElt fmt1 = CTRPrElt.Factory.newInstance();
str.applyFont(formats, 0, 6, fmt1);
assertEquals(2, formats.size());
assertEquals("[6, 26]", formats.keySet().toString());
Object[] runs1 = formats.values().toArray();
assertSame(fmt1, runs1[0]);
assertSame(null, runs1[1]);
CTRPrElt fmt2 = CTRPrElt.Factory.newInstance();
str.applyFont(formats, 7, 15, fmt2);
assertEquals(4, formats.size());
assertEquals("[6, 7, 15, 26]", formats.keySet().toString());
Object[] runs2 = formats.values().toArray();
assertSame(fmt1, runs2[0]);
assertSame(null, runs2[1]);
assertSame(fmt2, runs2[2]);
assertSame(null, runs2[3]);
CTRPrElt fmt3 = CTRPrElt.Factory.newInstance();
str.applyFont(formats, 6, 7, fmt3);
assertEquals(4, formats.size());
assertEquals("[6, 7, 15, 26]", formats.keySet().toString());
Object[] runs3 = formats.values().toArray();
assertSame(fmt1, runs3[0]);
assertSame(fmt3, runs3[1]);
assertSame(fmt2, runs3[2]);
assertSame(null, runs3[3]);
CTRPrElt fmt4 = CTRPrElt.Factory.newInstance();
str.applyFont(formats, 0, 7, fmt4);
assertEquals(3, formats.size());
assertEquals("[7, 15, 26]", formats.keySet().toString());
Object[] runs4 = formats.values().toArray();
assertSame(fmt4, runs4[0]);
assertSame(fmt2, runs4[1]);
assertSame(null, runs4[2]);
CTRPrElt fmt5 = CTRPrElt.Factory.newInstance();
str.applyFont(formats, 0, 26, fmt5);
assertEquals(1, formats.size());
assertEquals("[26]", formats.keySet().toString());
Object[] runs5 = formats.values().toArray();
assertSame(fmt5, runs5[0]);
CTRPrElt fmt6 = CTRPrElt.Factory.newInstance();
str.applyFont(formats, 15, 26, fmt6);
assertEquals(2, formats.size());
assertEquals("[15, 26]", formats.keySet().toString());
Object[] runs6 = formats.values().toArray();
assertSame(fmt5, runs6[0]);