Improved example of Java WebSocket client