code: @Deprecated
      public Integer getTaskIdByBuildId(int buildId) {
          List<Integer> result = tasks.values().stream()
                  .filter(t -> t instanceof BpmBuildTask)
                  .filter(t -> ((BpmBuildTask) t).getBuildTask().getId() == buildId)
                  .map(BpmTask::getTaskId)
                  .collect(Collectors.toList());
          if (result.size() > 1)
              throw new IllegalStateException("More that one task with the same build id: " + result);
          return result.size() == 1 ? result.get(0) : null;
      }
docs: This method solves backwards compatibility problem.
  It will be removed soon.