code: public void checkcast(TypeMirror type) throws IOException
      {
          switch (type.getKind())
          {
              case ARRAY:
                  ArrayType array = (ArrayType) type;
                  int index = subClass.resolveClassIndex(array);
                  checkcast(index);
                  break;
              case DECLARED:
                  DeclaredType dt = (DeclaredType) type;
                  TypeElement te = (TypeElement) dt.asElement();
                  checkcast(te);
                  break;
              case TYPEVAR:
                  TypeVariable tv = (TypeVariable) type;
                  checkcast(tv.getUpperBound());
                  break;
          }
      }
docs: Check whether object is of given type
  <p>Stack: ..., objectref =&gt; ..., objectref
  @param type
  @throws IOException