code: public @Nonnull ThreadDumpRuntime fromProcess(@Nonnull Process process) throws IOException, InterruptedException, UnsupportedOperationException {
          try {
              int exitValue = process.exitValue();
              throw new IllegalStateException("Process terminated with " + exitValue);
          } catch (IllegalThreadStateException expected) {
              // Process alive
          }
  
          long pid = extractPid(process);
          return fromProcess(pid);
      }
docs: Extract runtime from running process.
  @param process Jvm process.
  @throws UnsupportedOperationException Process implementation is not supported.
  @throws IllegalStateException Process has already terminated.
  @throws IOException Unable to extract runtime from the process.