title: unique number of words in a propertyfile
body: <p>What is the optimum way  to count the unique number of words in a propertyfile (Just the Values) in java (java 1.8)
  for example entries may be:</p>
  
  <pre><code>key1=This is my value for error {0}
  key2=This is success message.Great.
  </code></pre>
  
  <p>Output should be 10 (including {0})</p>
  
  <p>What I tried</p>
  
  <pre><code>property.load(in);
  
              Enumeration em = property.keys();
              while (em.hasMoreElements()) {
                  String str = (String) em.nextElement();
                  completeString =completeString+property.get(str);
  
              }
  Set&lt;String&gt; myset=new HashSet&lt;&gt;();
          String s[]=completeString.split("[ .]");
  
          for(int i=1;i&lt;s.length;i++){
  
                  myset.add(s[i]);
  
           }
  
           for (String sss: myset){
  
              System.out.println(sss);
  
          }
  </code></pre>
  
  <p>System.out.println(myset.size());</p>
  
  <p>Do we have a simpler way in java 1.8</p>