code: public SubscribeData subscribe(Collection<Statistic> statistics) throws WorkspaceApiException {
          try {
              StatisticsSubscribeData subscribeData = new StatisticsSubscribeData();
              StatisticsSubscribeDataData data = new StatisticsSubscribeDataData();
              data.setStatistics(new ArrayList<>(statistics));
              subscribeData.setData(data);
              InlineResponse2002 resp = api.subscribe(subscribeData);
              Util.throwIfNotOk(resp.getStatus());
              
              InlineResponse2002Data respData = resp.getData();
              if(respData == null) {
                  throw new WorkspaceApiException("Response data is empty");
              }
              
              SubscribeData result = new SubscribeData();
              result.setSubscriptionId(respData.getSubscriptionId());
              result.setStatistics(respData.getStatistics());
              return result;
          }
          catch(ApiException ex) {
              throw new WorkspaceApiException("Cannot subscribe", ex);
          }
      }
docs: Subscribe to a group of statistics. The values are returned when you request them using `peek()`.
  
  @param statistics The collection of statistics you want to include in your subscription.
  @return SubscribeData
  @throws WorkspaceApiException