docs: public static BuildRetention createBuildRetention(Run build, boolean discardOldArtifacts) {
          BuildRetention buildRetention = new BuildRetention(discardOldArtifacts);
          LogRotator rotator = null;
          BuildDiscarder buildDiscarder = build.getParent().getBuildDiscarder();
          if (buildDiscarder != null && buildDiscarder instanceof LogRotator) {
              rotator = (LogRotator)  buildDiscarder;
          }
          if (rotator == null) {
              return buildRetention;
          }
          if (rotator.getNumToKeep() > -1) {
              buildRetention.setCount(rotator.getNumToKeep());
          }
          if (rotator.getDaysToKeep() > -1) {
              Calendar calendar = Calendar.getInstance();
              calendar.add(Calendar.DAY_OF_YEAR, -rotator.getDaysToKeep());
              buildRetention.setMinimumBuildDate(new Date(calendar.getTimeInMillis()));
          }
          List<String> notToBeDeleted = ExtractorUtils.getBuildNumbersNotToBeDeleted(build);
          buildRetention.setBuildNumbersNotToBeDiscarded(notToBeDeleted);
          return buildRetention;
      }