* Complex method test.
*/
public void testGetSiblingInstance() {
Element element = domFactory.createElement();
Element elementResult;
Text text = domFactory.createText();
Text textResult;
String textMessage = "atishoo, atishoo, we all fall down";
BasicMapperElement me = new BasicMapperElement("tr", element, false);
BasicMapperElement mt = new BasicMapperElement("td", text, true);
Node result;
char[] textResultMessage;
element.setName("br");
text.append(textMessage);
result = me.getSiblingInstance();
assertTrue("result should be an element",
(result instanceof Element));
elementResult = (Element)result;
assertTrue("sibling returned should not be the one passed in",
(element != elementResult));
assertEquals("sibling instance should have same name",
elementResult.getName(),
element.getName());
result = mt.getSiblingInstance();
assertTrue("result should be a text node",
(result instanceof Text));
textResult = (Text)result;
assertTrue("sibling returned should not be the one passed in",
(text != textResult));
assertEquals("sibling instance should have same content",
textResult.getLength(),
text.getLength());
textResultMessage = textResult.getContents();
for (int i = 0;
i < textMessage.length();
i++) {
assertEquals("content different at index " + i,