} else if(loginResponse.hasError()){
throw new IllegalStateException(loginResponse.getError().getExtension(0).getMessage());
}
System.out.println("Autheticated.");
BindAccountRequestPacket bindAccountRequestPacket = new BindAccountRequestPacket(service.getEmail(), ac2dmAuth);
BindAccountResponseFilter barf = new BindAccountResponseFilter(bindAccountRequestPacket.getPacketID());
connector.addFilter(barf);
send(session, bindAccountRequestPacket);
BindAccountResponse bindAccountResponse = barf.nextMessage(TIMEOUT);
connector.removeFilter(barf);