code: private static boolean obtainLicenseAgreement(LicenseProvider licenseProvider) {
          // Prompt for word-wrapped display of license agreement & information
          boolean view;
  
          SelfExtract.wordWrappedOut(SelfExtract.format("showAgreement", "--viewLicenseAgreement"));
          view = SelfExtract.getResponse(SelfExtract.format("promptAgreement"), "", "xX");
          if (view) {
              SelfExtract.showLicenseFile(licenseProvider.getLicenseAgreement());
              System.out.println();
          }
  
          SelfExtract.wordWrappedOut(SelfExtract.format("showInformation", "--viewLicenseInfo"));
          view = SelfExtract.getResponse(SelfExtract.format("promptInfo"), "", "xX");
          if (view) {
              SelfExtract.showLicenseFile(licenseProvider.getLicenseInformation());
              System.out.println();
          }
  
          System.out.println();
          SelfExtract.wordWrappedOut(SelfExtract.format("licenseOptionDescription"));
          System.out.println();
  
          boolean accept = SelfExtract.getResponse(SelfExtract.format("licensePrompt", new Object[] { "[1]", "[2]" }),
                                                   "1", "2");
          System.out.println();
  
          return accept;
      }
docs: Display and obtain agreement for the license terms