code: public static boolean isValid(ClassLoader classLoader, String className, int methodId, int continuationPointId) {
          if (className == null) {
              throw new NullPointerException();
          }
          if (continuationPointId < 0) {
              throw new IllegalArgumentException();
          }
  
          Class cls = null;
          if (classLoader == null) {
              // Try to find the class from this object's classloader
              try {
                  cls = MethodState.class.getClassLoader().loadClass(className);
              } catch (ClassNotFoundException cnfe) {
                  // do nothing
              }
              
              // Try to find the class from this Thread's classloader
              if (cls == null) {
                  try {
                      cls = Thread.currentThread().getContextClassLoader().loadClass(className);
                  } catch (ClassNotFoundException cnfe) {
                      // do nothing
                  }
              }
          } else {
              // Try to find the class the classloader provided
              try {
                  cls = classLoader.loadClass(className);
              } catch (ClassNotFoundException cnfe) {
                  // do nothing
              }
          }
  
  
  
          if (cls == null) {
              throw new IllegalStateException("Class this state is being deserialized for is missing: " + className);
          }
  
  
  
          String versionField = getIdentifyingFieldName(methodId, continuationPointId);
          try {
              cls.getDeclaredField(versionField);
          } catch (NoSuchFieldException nsfe) {
              return false;
          }
  
          return true;
      }
docs: Do not use -- for internal use only.
  <p>
  Determine if this method state is valid. Valid means that the method that this method state is for exists and the method is the
  correct version for this method state.
  @param classLoader class loader to use to look for the class ({@code null} will attempt to use this Object's classloader / the
  thread's context class loader)
  @param className class name
  @param methodId method id
  @param continuationPointId continuation point id
  @return {@code true} if method for this method state exists and is of the correct version, {@code false} otherwise
  @throws NullPointerException if {@code className} is {@code null}
  @throws IllegalArgumentException if {@code continuationPointId < 0}