class SearchService {

  /**
   * Below two methods of name `search` is overloaded so that we can send a default value for
   * one of the criteria and call the final api. A default SortOrder is sent in the first method
   * and a default SortBy is sent in the second method. So two separate method definitions are
   * needed for having default values for one argument in each case. Hence multiple overloaded
   * methods are needed as the number of argument increases.
   */
  public String search(String type, String sortBy) {
    return getQuerySummary(type, sortBy, SortOrder.ASC);
  }

  public String search(String type, SortOrder sortOrder) {
    return getQuerySummary(type, "price", sortOrder);
  }


  /**
   * The need for multiple method definitions can be avoided by the Parameter Object pattern.
   * Below is the example where only one method is required and all the logic for having default
   * values are abstracted into the Parameter Object at the time of object creation.
   */
  public String search(ParameterObject parameterObject) {
    return getQuerySummary(parameterObject.getType(), parameterObject.getSortBy(),
        parameterObject.getSortOrder());
  }

  private String getQuerySummary(String type, String sortBy, SortOrder sortOrder) {<FILL_FUNCTION_BODY>}
}

    return String.format("Requesting shoes of type \"%s\" sorted by \"%s\" in \"%sending\" order..",
        type,
        sortBy,
        sortOrder.getValue());
  
<no_super_class>