static boolean areUnprivilegedUserNameSpacesAllowed() {
    if (!SystemInfoRt.isLinux) {
      return false;
    }

    GeneralCommandLine cl = new GeneralCommandLine()
      .withExePath("unshare")
      .withParameters("--user", "--map-root-user", "echo");

    try {
      CapturingProcessHandler handler = new CapturingProcessHandler(cl);
      ProcessOutput output = handler.runProcess();
      if (output.getExitCode() == 0) {
        return true;
      }

      LOG.warn("Unprivileged user namespaces check failed: " + output.getStderr());
      return false;
    }
    catch (ExecutionException e) {
      LOG.warn("Failed to check unprivileged user namespaces restrictions(considered as restricted): " + e.getMessage());
      return false;
    }
  }
static boolean areUnprivilegedUserNameSpacesAllowed()