code: @Override
      public double doCalculateItemAgreement(final ICodingAnnotationItem item)
      {
          SetAnnotation setAnnotation = null;
          int numberOfCategories = 0;
          for (IAnnotationUnit annotationUnit : item.getUnits()) {
              SetAnnotation raterSetAnnotation = (SetAnnotation) (annotationUnit
                      .getCategory());
              numberOfCategories += raterSetAnnotation.size();
              if (setAnnotation == null) {
                  setAnnotation = new SetAnnotation(raterSetAnnotation);
              }
              else {
                  setAnnotation.retainAll(raterSetAnnotation);
              }
              if (setAnnotation.size() == 0) {
                  return 0.0;
              }
          }
          return item.getRaterCount() * item.getRaterCount()
                  * setAnnotation.size() / (double) numberOfCategories;
      }
docs: Calculates the inter-rater agreement for the given annotation item. This
  is the basic step that is performed for each item of an annotation study,
  when calling {@link #calculateAgreement()}.
  
  @throws NullPointerException
  if the given item is null.