@Test
  public void testBuffer() {
    MessageBuffer b = new MessageBuffer();
    b.append("Hello, world");
    b.appendNewLine();
    b.append("how are you?");

    CharSequence s = b.getBuffer();
    assertEquals("Hello, world\nhow are you?", s.toString());
  }
 private GroupExtension parse(CharSequence xml)
     throws IOException, XmlPullParserException, SmackException {
   XmlPullParser parser = new KXmlParser();
   parser.setInput(new StringReader(xml.toString()));
   parser.next();
   return provider.parse(parser, 0);
 }