code: @Override
      public boolean hasInstance(Scriptable value) {
  
          if (value instanceof Wrapper &&
              !(value instanceof NativeJavaClass)) {
              Object instance = ((Wrapper)value).unwrap();
  
              return getClassObject().isInstance(instance);
          }
  
          // value wasn't something we understand
          return false;
      }
docs: Determines if prototype is a wrapped Java object and performs
  a Java "instanceof".
  Exception: if value is an instance of NativeJavaClass, it isn't
  considered an instance of the Java class; this forestalls any
  name conflicts between java.lang.Class's methods and the
  static methods exposed by a JavaNativeClass.