Duplicate words in a text
Your use of the boolean return value of the Set.add() call is a clever way to check for your duplicates. The concept you have is good, and I can't think of a faster way.

Additionally, I like how you have used Interface-based types on the left-side of assignments Set&lt;String&gt; and the concrete classes on the right new HashSet&lt;&gt;() .... people often put the concrete type on the left too, and it's good to see that you did not.

In terms of the Java streaming API, though, I can't help but feel that you missed out on an opportunity to improve the process by streaming the split.... The Pattern class has a splitAsStream method which would reduce your latency on the first words....

As an aside, a word should probably be on a contiguous whitespace, not just a single space (i.e. "\\s+" instead of " ").

Here's your code done differently:

private static final Pattern SPACE = Pattern.compile("\\s+");

public static Set&lt;String&gt; findDuplicateWordsInText(String text) {
    Set&lt;String&gt; duplicatesRemovedSet = new HashSet&lt;&gt;();
    return SPACE.splitAsStream(text)
            .filter(string -&gt; !duplicatesRemovedSet.add(string))
            .collect(Collectors.toSet());
}