title: HashSet prints blank values to the console
body: <p>why this nounPhrases is printing a blank [ ]  ? where i have done wrong ? I got a working  code from this site <a href="http://harmeetsingh13.blogspot.com/2013/05/search-noun-adjectives-verbs-from-text.html" rel="nofollow noreferrer">(Woriking code exaple)</a> and it works fine. But my code is not working. i cant print my nouns to the console. It prints a couple of [ ] in my console.</p>
  
  <pre><code>import java.io.FileInputStream;
  import java.io.InputStream;
  import java.util.HashSet;
  import java.util.Set;
  
  import com.sun.corba.se.impl.orb.ParserAction;
  
  import opennlp.tools.cmdline.parser.ParserTool;
  import opennlp.tools.parser.Parse;
  import opennlp.tools.parser.Parser;
  import opennlp.tools.parser.ParserFactory;
  import opennlp.tools.parser.ParserModel;
  
  public class ParserTest {
  
  
  
      public static Set&lt;String&gt; nounPhrases = new HashSet&lt;&gt;();
  
          public String line="i need a java book";
  
  
      public void getNounPhrases(Parse p) {
          if (p.getType().equals("NN") || p.getType().equals("NNS") || p.getType().equals("NNP")
                  || p.getType().equals("NNPS")) {
              nounPhrases.add(p.getCoveredText());
              // System.out.println(p.getCoveredText());
          }
  
          for (Parse child : p.getChildren()) {
              getNounPhrases(child);
  
          }
      }
  
      public void parserAction() throws Exception {
          InputStream is = new FileInputStream("en-parser-chunking.bin");
          ParserModel model = new ParserModel(is);
          Parser parser = ParserFactory.create(model);
          Parse topParses[] = ParserTool.parseLine(line, parser, 1);
          for (Parse p : topParses) {
              // p.show();
              getNounPhrases(p);
          }
      }
  
  
      public void showNouns() {
  
          try {
              new ParserTest().parserAction();
              System.out.println("these are nouns"+nounPhrases);
          } catch (Exception e) {
  
              e.printStackTrace();
          }
  
          System.out.println("these are nouns"+nounPhrases);
      }
  
  
  }
  </code></pre>
  
  <p>when i add main method to the class..it works fine </p>
  
  <pre><code>public static void main(String[] args) throws Exception {
        new ParserTest().parserAction();
        System.out.println("List of Noun Parse : "+nounPhrases);
  </code></pre>