Find the uncommon elements from two sets
Is this a method?  You can't just plop code anywhere in Java.

The name of the operation is symmetric difference, so you should probably call it that.

Here's a more compact implementation.

private Set&lt;T&gt; symmetricDifference(Set&lt;T&gt; a, Set&lt;T&gt; b) {
    Set&lt;T&gt; result = new HashSet&lt;T&gt;(a);
    for (T element : b) {
        // .add() returns false if element already exists
        if (!result.add(element)) {
            result.remove(element);
        }
    }
    return result;
}