code: public static void checkSecurity() {
          SecurityManager securityManager = System.getSecurityManager();
          if (securityManager != null) {
              securityManager.checkPermission(new ManagementPermission(PERMISSION_NAME_CONTROL));
          }
      }
docs: If JVM security manager exists then checks JVM security 'control' permission.