@Test
	public void stessTest() {
		try {
			Server server = new Server(4445, debug);
			server.start();
			
			String address = "localhost";
			
			int number = 1000;
			
			Socket user[] = new Socket[number];
			ObjectInputStream in[] = new ObjectInputStream[number];
			ObjectOutputStream out[] = new ObjectOutputStream[number];
			
			for (int i = 0; i < number; i++) {
				user[i] = new Socket(address, 4445);
				if (i < 500) {
					in[i] = new ObjectInputStream(user[i].getInputStream());
					assert(checkMessage((Message)in[i].readObject(), "MESSAGE { Type: Response, Code: 100, Status: Welcome }"));
					out[i] = new ObjectOutputStream(user[i].getOutputStream());
				} else
					try {
						in[i] = new ObjectInputStream(user[i].getInputStream());
						assert(false);
					} catch (Exception e2) {
					}
			}
			
			for (int i = 0; i < 500; i++) {
				Message message = new Message();
				message.setType(Type.Login);
				message.setUser(String.format("user%d", i));
				out[i].writeObject(message);
				assert(checkMessage((Message)in[i].readObject(), String.format("MESSAGE { Type: Login, Code: 101, Status: Welcome user%d }", i)));
			}
			
			for (int i = 0; i < 500; i = i + 5) {
				Message message = new Message();
				message.setType(Type.Friends);
				String[] friends = new String[4];
				for (int j = 0; j < 4; j++) {
					friends[j] = String.format("user%d", j+1);
				}
				message.setFriends(friends);
				out[i].writeObject(message);
				message = (Message)in[i].readObject();
				checkMessage(message, "");
				assert(message.getCode() == 303);
				for (int j = 1; j < 5; j++) {
					assert(checkMessage((Message)in[j].readObject(), String.format("MESSAGE { Type: Friends, User: user%d, Code: 305 }", i)));
				}
			}
			
			for (int i = 0; i < 500; i = i + 5) {
				
			}
			
			server.kill();
		} catch (Exception e) {
			System.out.println("Marco");
			assert(false);
		}
	}