code: public byte[] sendWithResult(final byte[] message) {
          synchronized (webSocketHandler.getNotifyResultObject()) {
              webSocketHandler.sendMessage(message);
  
              try {
                  webSocketHandler.getNotifyResultObject().wait(TimeUnit.SECONDS.toMillis(ANSWER_TIMEOUT));
              }
              catch (InterruptedException e) {
                  return null;
              }
  
              return webSocketHandler.getResultBytes();
          }
      }
docs: Sends a message through it's websocket connection to the server and waits for the reply.
  @param message json message in binary format
  @return answer from the server in json binary format