Identifying which paragraph, if any, is a superset of all words in a document
Your code is suffering from a lack of functions. Functions help to identify what core parts of your code does, and makes those parts reusable. It also makes the calling code more readable.

By using functions, and extracting core components, it's easy to see the actual logic. For example, a main method like:

public static void main(String[] args) throws IOException {
    List&lt;Set&lt;String&gt;&gt; paragraphs = composeParagraphs(Paths.get("java.txt"));
    int superIndex = superSetParagraph(paragraphs);
    System.out.println("SuperSet Paragraph is " + superIndex);
}


Well, that's simple enough... how is it done?

Given a list of paragraph sets, finding the paragraph which is a superset, is easy:

private static int superSetParagraph(List&lt;Set&lt;String&gt;&gt; paras) {
    // get all words from all paragraphs.
    Set&lt;String&gt; allwords = paras.stream().flatMap(p -&gt; p.stream()).collect(Collectors.toSet());
    // which paragraph has all words.
    for (int i = 0; i &lt; paras.size(); i++) {
        if (paras.get(i).size() == allwords.size()) {
            return i + 1;
        }
    }
    return 0;
}


How do you get all paragraphs?

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

public static Set&lt;String&gt;words(String input) {
    return Arrays.stream(SPACE.split(input))
          .filter(word -&gt; !word.isEmpty())
          .collect(Collectors.toSet());
}

private static List&lt;Set&lt;String&gt;&gt; composeParagraphs(Path path) throws IOException {
    Set&lt;String&gt; para = new HashSet&lt;&gt;();
    List&lt;Set&lt;String&gt;&gt; contents = new ArrayList&lt;&gt;();
    for (String line : Files.readAllLines(path)) {
        if (line.trim().isEmpty()) {
            // indicates a new paragraph....
            if (!para.isEmpty()) {
                contents.add(para);
                para = new HashSet&lt;&gt;();
            }
        } else {
            para.addAll(words(line));
        }
    }
    if (!para.isEmpty()) {
        contents.add(para);
    }
    return contents;
}


Again, functional extraction makes a difference.