@Test
    public void tryLogin() {
        final Server server;
        ClientModel clientModel;
        String usernames[] = new String[] { "Sanath", "Dennis", "Andrew",
                "Rohan", "Dog", "Cat" };
        long timeout = 200;

        try {
            // Run a server thread.
            server = new Server(PORT);
            Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    server.serve();
                }
            });
            t.start();

            // Create client and server models
            ServerConnectionHandlerThread.serverModel = new ServerModel();
            clientModel = new ClientModel(new Socket(HOST, PORT));

            // Log the users in
            for (String username : usernames) {
                clientModel.requestUser(username);
            }
            
            // wait a bit for good measure
            Thread.sleep(timeout);

            // Check in the serverModel that we're all logged in
            for (String username : usernames) {
                assert ServerConnectionHandlerThread.serverModel
                        .isUserLoggedIn(username);
            }

            // clean up and wait
            server.stop();
            t.stop();
            Thread.sleep(timeout);
        } catch (Exception e) {
            System.out.println(e.toString());
            assert false;
        }
    }