private class RemoveFunction extends ScriptableFunctionBase {
protected Object execute(Object thiz, Object[] args) throws Exception {
Object arg0 = args[0];
if(arg0 instanceof BBMPlatformUser) {
BBMPlatformUser user = (BBMPlatformUser) arg0;
BBMPlatformContact contact = (BBMPlatformContact) user.getPresence();
_connection.remove(contact);
} else if(arg0 instanceof Scriptable) {
BBMPlatformUser[] usersArray = Util.scriptableUsersArrayToUserArray((Scriptable) arg0);
BBMPlatformContactList contactList = Util.userArrayToContactList(usersArray);
_connection.remove(contactList);