code: @Override
      public void sendData(TreeSet<Data> data) {
          if (data == null) {
              throw new IllegalArgumentException("Data must be not null");
          }
          if (data.isEmpty()) {
              return;
          }
  
          addData(data);
  
          if (distributed) {
              partitionManager.notifyData(new ArrayList<>(data));
          }
      }
docs: use synchronized blocks to protect pendingData.