public void testCharacterPropOrdering() throws Exception {
StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);
stpb.setParentTextSize(data_b_text_len);
LinkedList b_ch_l = stpb.getCharacterStyles();
TextPropCollection b_ch_1 = (TextPropCollection)b_ch_l.get(0);
TextPropCollection b_ch_2 = (TextPropCollection)b_ch_l.get(1);
TextPropCollection b_ch_3 = (TextPropCollection)b_ch_l.get(2);
TextPropCollection b_ch_4 = (TextPropCollection)b_ch_l.get(3);
// In first set, we get a CharFlagsTextProp and a font.size
assertEquals(2,b_ch_1.getTextPropList().size());
TextProp tp_1_1 = (TextProp)b_ch_1.getTextPropList().get(0);
TextProp tp_1_2 = (TextProp)b_ch_1.getTextPropList().get(1);
assertEquals(true, tp_1_1 instanceof CharFlagsTextProp);
assertEquals(true, tp_1_2 instanceof TextProp);
assertEquals("font.size", tp_1_2.getName());
assertEquals(20, tp_1_2.getValue());
// In second set, we get a CharFlagsTextProp and a font.size and a font.color
assertEquals(3,b_ch_2.getTextPropList().size());
TextProp tp_2_1 = (TextProp)b_ch_2.getTextPropList().get(0);
TextProp tp_2_2 = (TextProp)b_ch_2.getTextPropList().get(1);
TextProp tp_2_3 = (TextProp)b_ch_2.getTextPropList().get(2);
assertEquals(true, tp_2_1 instanceof CharFlagsTextProp);
assertEquals(true, tp_2_2 instanceof TextProp);
assertEquals(true, tp_2_3 instanceof TextProp);
assertEquals("font.size", tp_2_2.getName());
assertEquals("font.color", tp_2_3.getName());
assertEquals(20, tp_2_2.getValue());
// In third set, it's just a font.size and a font.color
assertEquals(2,b_ch_3.getTextPropList().size());
TextProp tp_3_1 = (TextProp)b_ch_3.getTextPropList().get(0);
TextProp tp_3_2 = (TextProp)b_ch_3.getTextPropList().get(1);
assertEquals(true, tp_3_1 instanceof TextProp);
assertEquals(true, tp_3_2 instanceof TextProp);
assertEquals("font.size", tp_3_1.getName());
assertEquals("font.color", tp_3_2.getName());
assertEquals(20, tp_3_1.getValue());
// In fourth set, we get a CharFlagsTextProp and a font.index and a font.size
assertEquals(3,b_ch_4.getTextPropList().size());
TextProp tp_4_1 = (TextProp)b_ch_4.getTextPropList().get(0);
TextProp tp_4_2 = (TextProp)b_ch_4.getTextPropList().get(1);
TextProp tp_4_3 = (TextProp)b_ch_4.getTextPropList().get(2);
assertEquals(true, tp_4_1 instanceof CharFlagsTextProp);
assertEquals(true, tp_4_2 instanceof TextProp);
assertEquals(true, tp_4_3 instanceof TextProp);
assertEquals("font.index", tp_4_2.getName());
assertEquals("font.size", tp_4_3.getName());