### Question:
Presence extends MessageOrPresence<PresenceBuilder> implements PresenceView { public boolean isAvailable() { return type == Type.available; } @Deprecated // TODO: Remove in Smack 4.5.  Presence(Type type); @Deprecated // TODO: Remove in Smack 4.5.  Presence(Jid to, Type type); @Deprecated // TODO: Remove in Smack 4.5.  Presence(Type type, String status, int priority, Mode mode);   Presence(PresenceBuilder presenceBuilder);  Presence(Presence other); boolean isAvailable(); boolean isAway(); @Override Type getType(); @Deprecated // TODO: Remove in Smack 4.5. void setType(Type type); @Override String getStatus(); @Deprecated // TODO: Remove in Smack 4.5. void setStatus(String status); @Override int getPriority(); @Override byte getPriorityByte(); @Deprecated // TODO: Remove in Smack 4.5. void setPriority(int priority); void setPriority(byte priority); @Override Mode getMode(); @Deprecated // TODO: Remove in Smack 4.5. void setMode(Mode mode); @Override String getElementName(); @Override PresenceBuilder asBuilder(); @Override PresenceBuilder asBuilder(String id); @Override PresenceBuilder asBuilder(XMPPConnection connection); @Override String toString(); @Override XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace); @Deprecated @Override Presence clone(); @Deprecated Presence cloneWithNewId(); static final String ELEMENT; }### Answer:
@Test public void isPresenceAvailableTest() { PresenceBuilder presence = getNewPresence(); presence.ofType(Presence.Type.available); assertTrue(presence.build().isAvailable()); presence.ofType(Presence.Type.unavailable); assertFalse(presence.build().isAvailable()); }