Get all objects which contains any given array of Enums What this does?:

Interactions is an Enum whereas Interactable is an interface (not @Functional Interface). Every Interactable has a list of Interactions that it can do. The below code snippet, filters out all the objects that contains any of the provided Interactions. It does not check for all Interactions, so if any of the given Interactions found, it adds the object in interactableList. Once done iterative over the List, sends it back to the caller for further processing.

public List&lt;Interactable&gt; getObjectsByInteractions (final Interactions[] interactions) {
    final List&lt;Interactable&gt; interactableList = new ArrayList&lt;&gt;();
    for (Interactable object : objects) {
        List&lt;Interactions&gt; objectInteractions = object.getInteractions();
        for (Interactions interactions1 : interactions) {
            if (objectInteractions.contains(interactions1)) {
                interactableList.add(object);
                break;
            }
        }
    }
    return interactableList;
}


Concern:

Right now, I am using pre Java 8 code style to achieve the results. Since, it's the time of Java 8, I would request the reviewers to suggest Java 8 style.
There is nothing particularly wrong with your current code, although I have a couple of comments:


The name interactions1 of the local variable is slightly confusing.
Instead of having a break, you could have a separate method that determines if a given Interactable contains as interactions one of the given interactions.


With the Stream API, you could have the following:

public List&lt;Interactable&gt; getObjectsByInteractions(final Interactions[] interactions) {
    return objects.stream()
                  .filter(object -&gt; Arrays.stream(interactions).anyMatch(object.getInteractions()::contains))
                  .collect(Collectors.toList());
}


This creates a Stream&lt;Interactable&gt; of your objects. It then filters out all the unwanted object: for that a Stream&lt;Interactions&gt; of the given interactions is created and anyMatch tells whether object.getInteractions() contains one of those interactions. Finally, the elements are collected into a list.