code: private void buildOrderBy(final StringBuilder orderByBuilder, final Map<String, SortDirection> sorts) {
          boolean isFirst = true;
          String querySortDirection;
  
          for (final Map.Entry<String, SortDirection> sort : sorts.entrySet()) {
              if (isFirst) {
                  orderByBuilder.append(" ORDER BY ");
                  isFirst = false;
              } else {
                  orderByBuilder.append(", ");
              }
  
              if (sort.getValue().equals(SortDirection.ASCENDING)) {
                  querySortDirection = "ASC";
              } else {
                  querySortDirection = "DESC";
              }
              orderByBuilder.append(sort.getKey()).append(" ").append(querySortDirection);
          }
      }
docs: Builds 'ORDER BY' part with the specified order by build and sorts.
  
  @param orderByBuilder the specified order by builder
  @param sorts          the specified sorts