code: public static boolean isRemoteable(Class<?> valueClass, int rmicCompatible) {
          // NOTE: This logic must be kept in sync with write_value.
  
          return valueClass.isInterface() &&
                 valueClass != Serializable.class &&
                 valueClass != Externalizable.class &&
                 (isCORBAObject(valueClass, rmicCompatible) ||
                  Remote.class.isAssignableFrom(valueClass) ||
                 isAbstractInterface(valueClass, rmicCompatible));
      }
docs: Determines whether a value of the specified type could be a remote
  object reference. This should return true if read_Object or
  read_abstract_interface is used for this type.
  
  @param clazz class for a method parameter or return type
  that needs to be read from an input stream
  @param rmicCompatible rmic compatibility flags
  @return true if a stub is needed