Here is my code which is going to through multiple for loops to get the matching product attribute.I have single product with attributes trying to find out the matching product with same attribute value from a list of Product. I am having a multiple for loop. Can anyone suggest a way to optimize this solution?// This is my single product which is empty with listOf attributes// (Example : brand, size, color etc.)Product singleProduct = new Product().setAttrs(    new ArrayList<ProductAttribute>());int productFound = 0;// Get List of product from respose objectList<Product> products = response.getProductList();for (Product product : products) {    for (ProductAttribute proAttr : product.getAttrs()) {        for (ProductAttribute singleProdAttr : singleProduct.getAttrs()) {            if (proAttr.getValue().equals(singleProdAttr.getValue())) {                productFound++;            }        }    }}
Counting items that have a matching attribute
java;performance;join