code: public static boolean isInstanceOf(Object o, Type t)
    {
      if(o == null) {
        return false;
      }
      if(t instanceof Class) {
        Class<?> clazz = (Class<?>)t;
        if(clazz.isPrimitive()) {
          return BOXING_MAP.get(clazz) == o.getClass();
        }
        return clazz.isInstance(o);
      }
      return false;
    }
docs: Test if object instance is not null and extends or implements expected type. This predicate consider primitive and
  related boxing types as equivalent, e.g. <code>1.23</code> is instance of {@link Double}.
  
  @param o object instance to test, possible null,
  @param t expected type.
  @return true if instance is not null and extends or implements requested type.