Assert.assertEquals(xml, "<presence from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"unavailable\"><show>chat</show></presence>");
}
@Test
public void testIsAvailable() throws JAXBException, XMLStreamException {
Presence presence1 = new Presence();
Assert.assertTrue(presence1.isAvailable());
Presence presence2 = new Presence(Presence.Type.SUBSCRIBE);
Assert.assertFalse(presence2.isAvailable());
Presence presence3 = new Presence(Presence.Type.UNSUBSCRIBED);
Assert.assertFalse(presence3.isAvailable());
Presence presence4 = new Presence(Presence.Type.UNSUBSCRIBE);
Assert.assertFalse(presence4.isAvailable());
Presence presence5 = new Presence(Presence.Type.SUBSCRIBED);
Assert.assertFalse(presence5.isAvailable());
Presence presence6 = new Presence(Presence.Type.ERROR);
Assert.assertFalse(presence6.isAvailable());
Presence presence7 = new Presence(Presence.Type.PROBE);
Assert.assertFalse(presence7.isAvailable());
Presence presence8 = new Presence(Presence.Type.UNAVAILABLE);
Assert.assertFalse(presence8.isAvailable());
}