code: public static <T extends TOP> Collection<T> selectFromAllViews(JCas jCas, Class<T> type)
      {
          Collection<T> result = new ArrayList<T>();
  
          try {
              Iterator<JCas> viewIterator = jCas.getViewIterator();
              while (viewIterator.hasNext()) {
                  JCas next = viewIterator.next();
  
                  result.addAll(JCasUtil.select(next, type));
              }
  
              return result;
          }
          catch (CASException ex) {
              throw new RuntimeException(ex);
          }
      }
docs: Same as {@linkplain org.apache.uima.fit.util.JCasUtil#select(org.apache.uima.jcas.cas.FSArray, Class)}
  but works across all views in jcas.
  
  @param jCas jcas
  @param type desired type
  @return collection of annotations