code: public Multimap<TextAnnotation, EntityAnnotation> getBestAnnotations() {
  
          Ordering<EntityAnnotation> o = new Ordering<EntityAnnotation>() {
              @Override
              public int compare(EntityAnnotation left, EntityAnnotation right) {
                  return Doubles.compare(left.confidence, right.confidence);
              }
          }.reverse();
  
          Multimap<TextAnnotation, EntityAnnotation> result = ArrayListMultimap.create();
          for (TextAnnotation ta : getTextAnnotations()) {
              List<EntityAnnotation> eas = o.sortedCopy(getEntityAnnotations(ta));
              if (!eas.isEmpty()) {
                  Collection<EntityAnnotation> highest = new HashSet<>();
                  Double confidence = eas.get(0).getConfidence();
                  for (EntityAnnotation ea : eas) {
                      if (ea.confidence < confidence) {
                          break;
                      } else {
                          highest.add(ea);
                      }
                  }
                  result.putAll(ta, highest);
              }
          }
  
          return result;
      }
docs: Returns the best {@link EntityAnnotation}s (those with the highest confidence value) for each extracted {@link TextAnnotation}
  
  @return best annotations