@Override
  public Set<Product> getProductsBypriceFilter(Map<String, List<String>> filterParams) {
    Set<Product> productsByLowPrice = new HashSet<Product>();
    Set<Product> productsByHighPrice = new HashSet<Product>();

    Set<String> price = filterParams.keySet();

    if (price.contains("low")) {
      for (String priceLow : filterParams.get("low")) {
        for (Product product : listOfProducts) {
          if (product.getUnitPrice().compareTo(new BigDecimal(Double.parseDouble(priceLow))) > 0) {
            productsByLowPrice.add(product);
          }
        }
      }
    }
    if (price.contains("high")) {
      for (String priceLow : filterParams.get("high")) {
        for (Product product : listOfProducts) {
          if (product.getUnitPrice().compareTo(new BigDecimal(Double.parseDouble(priceLow))) < 0) {
            productsByHighPrice.add(product);
          }
        }
      }
    }
    productsByHighPrice.retainAll(productsByLowPrice);
    return productsByHighPrice;
  }
  public Set<Product> getProductsByPriceFilter(Map<String, List<String>> filterParams) {

    Set<Product> productsByPriceFilter = new HashSet<Product>();
    Set<String> criterias = filterParams.keySet();
    if (criterias.contains("low")) {
      if (criterias.contains("high")) {
        String min = filterParams.get("low").get(0);
        BigDecimal minMoney = new BigDecimal(min.replaceAll(",", ""));

        String max = filterParams.get("high").get(0);
        BigDecimal maxMoney = new BigDecimal(max.replaceAll(",", ""));

        for (Product product : listOfProducts) {
          if (product.getUnitPrice().compareTo(minMoney) >= 0
              && product.getUnitPrice().compareTo(maxMoney) <= 0) {
            productsByPriceFilter.add(product);
          }
        }
      }
    }

    return productsByPriceFilter;
  }