code: public TestSet parseFile(File file, boolean generateTapFile) {
  
          TestSet testSet = new TestSet();
          final Header header = new Header(TAP_VERSION);
          testSet.setHeader(header);
  
          List<AbstractSample> sampleResultList = getResultList(file);
          Plan plan = new Plan(INITIAL_TEST_STEP, sampleResultList.size());
          testSet.setPlan(plan);
  
          for (AbstractSample httpSample : sampleResultList) {
              List<AssertionResult> assetionResultList = httpSample.getAssertionResult();
              boolean resultError = false;
              String failitureMessage = "";
              String severity = "";
              // Searching an assertion failed
              for (AssertionResult assertionResult : assetionResultList) {
                  resultError = (assertionResult.isFailure() || assertionResult.isError());
                  if (resultError) {
                      failitureMessage += FAILURE_MESSAGE + assertionResult.getFailureMessage();
  
                      // Log the type of fail
                      if (assertionResult.isFailure()) {
                          severity = FAIL_ASSERT;
                      }
                      if (assertionResult.isError()) {
                          severity += ERROR;
                      }
                  }
              }
  
              TestResult testResult = new TestResult();
              testResult.setDescription(httpSample.getLb());
              StatusValues status = StatusValues.OK;
              if (resultError) {
                  final Map<String, Object> yamlish = testResult.getDiagnostic();
                  createYAMLishMessage(yamlish, httpSample, failitureMessage);
                  createYAMLishSeverity(yamlish, severity);
                  createYAMLishDump(yamlish, httpSample);
                  status = StatusValues.NOT_OK;
              }
              testResult.setStatus(status);
              testSet.addTestResult(testResult);
          }
  
          if (generateTapFile) {
              generateTapFile(file, testSet);
          }
  
          return testSet;
      }
docs: Parses jMeter result file into TestSet and optionally generates a Tap file with the same name of the parsed file
  
  @param file the file
  @param generateTapFile flag to generate a TAP file or not
  @return a not nullable {@TestSet}