Using Java stream to filter a list and create a map
This transformation is not so obvious, but still feasible without instantiating a dedicated Map directly and without using forEach.

First of all, I suggest to implement hashCode and equals in Hotel and OTAProperty classes: this is often useful, especially when storing objects in collections.

Here is how the functional sequence can look like:

public static Map&lt;Long, Hotel&gt; createHotelMapByOtaName2(List&lt;Hotel&gt; hotels, String otaName) {
  return hotels.stream()
             .map(hotel -&gt;
                hotel.getOtaProperties().stream()
                     .filter(op -&gt; otaName.equals(op.getOtaName())) // 1
                     .collect(Collectors.toMap(OTAProperty::getId,  
                                               (h) -&gt; hotel))) // 2
             .map(Map::entrySet) // 3
             .flatMap(Collection::stream) // 4
             .collect(Collectors.toMap(Map.Entry::getKey,
                                       Map.Entry::getValue)); // 5
}



Equivalent of the original if condition: we take only OTAProperties that match the required name.
Each hotel item is wrapped to a Map&lt;Long, Hotel&gt;, which is a subset of the resulting map.
Transformation of the stream of Maps into a stream of Set&lt;Entry&lt;Long, Hotel&gt;&gt;.
Concatenation of streams of Sets into a single stream of Entry&lt;Long, Hotel&gt;. Unfortunately, we cannot join Maps so easily, that is why there is this intermediate transformation.
Finally, the stream of entries is collected into a Map representing the result of the sequence.