code: @Override
    public @NotNull SortedSet<MediaFormat> getSameBiggerMediaFormats(@NotNull MediaFormat mediaFormatRequested, boolean filterRenditionGroup) {
      SortedSet<MediaFormat> matchingFormats = new TreeSet<>(new MediaFormatSizeRankingComparator());
  
      // if filter by rendition group is enabled, but the requested media format does not define one,
      // use only the requested format
      if (filterRenditionGroup && StringUtils.isEmpty(mediaFormatRequested.getRenditionGroup())) {
        matchingFormats.add(mediaFormatRequested);
      }
      else {
        for (MediaFormat mediaFormat : getMediaFormats()) {
  
          // if filter by rendition group is enabled, check only media formats of same rendition group
          if (!filterRenditionGroup
              || StringUtils.equals(mediaFormat.getRenditionGroup(), mediaFormatRequested.getRenditionGroup())) {
  
            // check if size matched (image size is same or bigger)
            if (isRenditionMatchSizeSameBigger(mediaFormat, mediaFormatRequested)) { //NOPMD
  
              // if media formats have ratios, check ratio (with tolerance)
              // otherwise add to list anyway, it *can* contain matching media items
              if (Ratio.matches(mediaFormat, mediaFormatRequested) //NOPMD
                  || !mediaFormat.hasRatio() || !mediaFormatRequested.hasRatio()) {
  
                // check for supported file extension
                if (isRenditionMatchExtension(mediaFormat)) { //NOPMD
                  matchingFormats.add(mediaFormat);
                }
              }
  
            }
  
          }
  
        }
      }
  
      return matchingFormats;
    }
docs: Get list of media formats that have the same (or bigger) resolution as the requested media format
  and (nearly) the same aspect ratio.
  @param mediaFormatRequested Requested media format
  @param filterRenditionGroup Only check media formats of the same rendition group.
  @return Matching media formats, sorted by size (biggest first), ranking, name