Function to get top k words in a given String
Initialize Set with values

Your method of initializing the hashset with values takes quite a bit of space. I would create a static field:

public static final String[] SEPARATORS = new String[] { " ", ",", ".", ";" };


And then use it like this:

public static final Set&lt;String&gt; separatorsSet = new HashSet&lt;String&gt;(Arrays.asList(SEPARATORS));


Extract code to methods

Your getTopStrings method currently does three things: extract words from string, count amount of duplicate words, sort the result of that by frequency. I would at least create separate methods for the first two and the third functionality.

Simplify Sorting

Your sorting mechanism using a queue seems overly complicated. If you are using Java 8, it could be reduced to three lines (or one really long one):

    // sort by value, reversed
    Stream&lt;Entry&lt;String, Integer&gt;&gt; sorted = wordMap.entrySet().stream().sorted(Map.Entry.comparingByValue((x,y) -&gt; (y &lt; x) ? -1 : ((x == y) ? 0 : 1))); // alternatively: use reversed and cast
    // flatten map to list:
    List&lt;String&gt; collected = sorted.map(entry -&gt; entry.getKey()).collect(Collectors.toCollection(ArrayList::new));
    // top k:
    List&lt;String&gt; topK = collected.subList(0, k);


Misc


in Java, it is customary to place curly brackets on the same line as the opening statements.
use curly brackets even for one line statements for improved readability and to avoid future bugs.
use more spaces, eg around ==, &lt;, +, after ;, etc for increased readability.
declare variables in as small a scope as possible to increase readability.