public <T extends C> List<T> findCoprocessors(Class<T> cls) {
    ArrayList<T> ret = new ArrayList<>();

    for (E env : coprocEnvironments) {
      C cp = env.getInstance();

      if (cp != null) {
        if (cls.isAssignableFrom(cp.getClass())) {
          ret.add((T) cp);
        }
      }
    }
    return ret;
  }
Find list of coprocessors that extend/implement the given class/interface
@param cls the class/interface to look for
@return the list of coprocessors, or null if not found
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java