docs: private static boolean closeDirectByteBufferPrivileged(final ByteBuffer byteBuffer, final LogNode log) {
          try {
              if (cleanMethod == null) {
                  if (log != null) {
                      log.log("Could not unmap ByteBuffer, cleanMethod == null");
                  }
                  return false;
              }
              if (VersionFinder.JAVA_MAJOR_VERSION < 9) {
                  if (attachmentMethod == null) {
                      if (log != null) {
                          log.log("Could not unmap ByteBuffer, attachmentMethod == null");
                      }
                      return false;
                  }
                  // Make sure duplicates and slices are not cleaned, since this can result in duplicate
                  // attempts to clean the same buffer, which trigger a crash with:
                  // "A fatal error has been detected by the Java Runtime Environment: EXCEPTION_ACCESS_VIOLATION"
                  // See: https://stackoverflow.com/a/31592947/3950982
                  if (attachmentMethod.invoke(byteBuffer) != null) {
                      // Buffer is a duplicate or slice
                      return false;
                  }
                  // Invoke ((DirectBuffer) byteBuffer).cleaner().clean()
                  final Method cleaner = byteBuffer.getClass().getMethod("cleaner");
                  if (cleaner == null) {
                      if (log != null) {
                          log.log("Could not unmap ByteBuffer, cleaner == null");
                      }
                      return false;
                  }
                  try {
                      cleaner.setAccessible(true);
                  } catch (final Exception e) {
                      if (log != null) {
                          log.log("Could not unmap ByteBuffer, cleaner.setAccessible(true) failed");
                      }
                      return false;
                  }
                  final Object cleanerResult = cleaner.invoke(byteBuffer);
                  if (cleanerResult == null) {
                      if (log != null) {
                          log.log("Could not unmap ByteBuffer, cleanerResult == null");
                      }
                      return false;
                  }
                  try {
                      cleanMethod.invoke(cleaner.invoke(byteBuffer));
                      return true;
                  } catch (final Exception e) {
                      if (log != null) {
                          log.log("Could not unmap ByteBuffer, cleanMethod.invoke(cleanerResult) failed: " + e);
                      }
                      return false;
                  }
              } else {
                  if (theUnsafe == null) {
                      if (log != null) {
                          log.log("Could not unmap ByteBuffer, theUnsafe == null");
                      }
                      return false;
                  }
                  // In JDK9+, calling the above code gives a reflection warning on stderr,
                  // need to call Unsafe.theUnsafe.invokeCleaner(byteBuffer) , which makes
                  // the same call, but does not print the reflection warning.
                  try {
                      cleanMethod.invoke(theUnsafe, byteBuffer);
                      return true;
                  } catch (final IllegalArgumentException e) {
                      // Buffer is a duplicate or slice
                      return false;
                  }
              }
          } catch (final ReflectiveOperationException | SecurityException e) {
              if (log != null) {
                  log.log("Could not unmap ByteBuffer: " + e);
              }
              return false;
          }
      }