I have a list of objects say Sales. I want only the Sales objects whose Product matches the ones in another list, say saleProductList.
Other than looping, is there a better way to do it.
However, whether this answers your question depends on what your motivation is for avoiding looping. Since Java collections do not have this functionality built-in, the only way to do it is to iterate over all the elements at some level. Guava does this internally, but it is still doing the same loop that you'd do manually, just dressed up in a nicer API.