Testing sockets with Java