public void testPingPong () throws IOException {
		final Data dataTCP = new Data();
		populateData(dataTCP, true);
		final Data dataUDP = new Data();
		populateData(dataUDP, false);

		final Server server = new Server(16384, 8192);
		server.getKryo().setRegistrationRequired(false);
		startEndPoint(server);
		server.bind(tcpPort, udpPort);
		server.addListener(new Listener() {
			public void connected (Connection connection) {
				connection.sendTCP(dataTCP);
				connection.sendUDP(dataUDP); // Note UDP ping pong stops if a UDP packet is lost.
			}

			public void received (Connection connection, Object object) {
				if (object instanceof Data) {
					Data data = (Data)object;
					if (data.isTCP) {
						if (!data.equals(dataTCP)) throw new RuntimeException("Fail!");
						connection.sendTCP(data);
					} else {
						if (!data.equals(dataUDP)) throw new RuntimeException("Fail!");
						connection.sendUDP(data);
					}
				}
			}
		});

		// ----

		final Client client = new Client(16384, 8192);
		client.getKryo().setRegistrationRequired(false);
		startEndPoint(client);
		client.addListener(new Listener() {
			public void received (Connection connection, Object object) {
				if (object instanceof Data) {
					Data data = (Data)object;
					if (data.isTCP) {
						if (!data.equals(dataTCP)) throw new RuntimeException("Fail!");
						connection.sendTCP(data);
					} else {
						if (!data.equals(dataUDP)) throw new RuntimeException("Fail!");
						connection.sendUDP(data);
					}
				}
			}
		});

		client.connect(5000, host, tcpPort, udpPort);

		waitForThreads(5000);
	}