Border border = null;
assertNull(aContext.getBorderTitle(border));
border = new TitledBorder(title1);
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title1);
border = new CompoundBorder(new TitledBorder(title1), new EmptyBorder(1, 1, 1, 1));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title1);
border = new CompoundBorder(new EmptyBorder(1, 1, 1, 1), new TitledBorder(title2));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title2);
border = new CompoundBorder(new TitledBorder(title1), new TitledBorder(title2));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title2);
border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
new TitledBorder(title2)), new CompoundBorder(new TitledBorder(title3),
new TitledBorder(title4)));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title4);
border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
new TitledBorder(title2)), new CompoundBorder(new TitledBorder(title3),
new EmptyBorder(1, 1, 1, 1)));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title3);
border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
new TitledBorder(title2)), new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
new EmptyBorder(1, 1, 1, 1)));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title2);
border = new CompoundBorder(new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
new TitledBorder(title2)), new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
new EmptyBorder(1, 1, 1, 1)));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title2);
border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
new EmptyBorder(1, 1, 1, 1)), new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
new EmptyBorder(1, 1, 1, 1)));
assertNotNull(aContext.getBorderTitle(border));
assertEquals(aContext.getBorderTitle(border), title1);
}