You simply don’t know the specific type created by that factory method (it guarantees to return Set, nothing else).
The only reliable way is to actually control what happens, by ending the stream operation with
... collect( Collectors.toCollection( LinkedHashSet::new ) );