code: private int getIndexOfClass(List list, Class cls) {
          for (int i = 0; i < list.size(); i++) {
              if (list.get(i).getClass().equals(cls)) {
                  return i;
              }
          }
          return -1;
      }
docs: get class index of list
  @param list
  @param cls
  @return