code: public static <T extends TOP> List<T> selectOverlapping(Class<T> type,
              Annotation annotation, JCas jCas)
      {
          Collection<T> allAnnotations = JCasUtil.select(jCas, type);
  
          List<T> result = new ArrayList<T>();
  
          for (T a : allAnnotations) {
              if ((a instanceof Annotation) && (JCasUtil2.doOverlap(annotation, (Annotation) a))) {
                  result.add(a);
              }
          }
  
          return result;
      }
docs: Selects annotations with desired type ({@code type} parameter) that overlap the given
  {@code annotation}, such that at least a part of the selected annotations
  {@link #doOverlap(org.apache.uima.jcas.tcas.Annotation, org.apache.uima.jcas.tcas.Annotation)}
  with the given {@code annotation}.
  See {@code JCasUtil2Test.testSelectOverlapping()} for details.
  
  @param type       desired type
  @param annotation current annotation for which the overlapping annotations are being selected
  @param jCas       the JCas
  @return collection of overlapping annotations