I am trying to create a set of items by looking through an existing set and adding each one to a resultant list if it meets certain conditions. I was wondering if there was a more efficient way to do this task using some of the Google Guava libraries. The algorithm is below
final List<String> matchingItems = new ArrayList<>();
for (final String li : getItems()) {
if (li.length() > 5) {
matchingItems.add(li);
}
}
return matchingItems;