title: Working with EnumSet
body: <p>This code works, but with a <code>try/catch box</code> . </p>
  
  <pre><code>public enum AccentuationUTF8 {/** */
          é, /** */è, /** */ç, /** */à, /** */ù, /** */
          ä, /** */ë, /** */ö, /** */ï, /** */ü, /** */
          â, /** */ê, /** */î, /** */ô, /** */û, /** */
  }
  ......
  
      final EnumSet&lt;AccentuationUTF8&gt; esUtf8 = EnumSet.noneOf(AccentuationUTF8.class);
      final String[] acc1 = {"é", "à", "u"};
      for (final String string : acc1) {
          try { // The ontologic problem
              esUtf8.add(AccentuationUTF8.valueOf(string));
          } catch (final Exception e) {
              System.out.println(string + " not an accent.");
          }
      }
      System.out.println(esUtf8.size() + "\t" + esUtf8.toString()
  </code></pre>
  
  <p>output :</p>
  
  <pre><code>u   not an accent.
  2   [é, à]
  </code></pre>
  
  <p>I want to generate an EnumSet with all accents of a word or of sentence.</p>
  
  <p><em>Edit after comments</em></p>
  
  <ul>
  <li>Is it possible to manage such an <code>EnumSet</code> without using <code>try</code> (needed by <code>AccentuationUTF8.valueOf(string)</code>?</li>
  <li>Is better way to code ?</li>
  </ul>
  
  <p><strong>FINAL EDIT</strong><br><br>
  Your responses suggest me a good solution : because <code>EnumSet.contains(Object)</code>, <code>throw an Exception</code>, change it : create a temporary <code>HashSet</code> able to return a <code>null</code> without Exception.<br> <br>
  So the <em>ugly</em> <code>try/catch</code> is now removed, code is now :</p>
  
  <pre><code>final Set&lt;String&gt; setTmp = new HashSet&lt;&gt;(AccentsUTF8.values().length);
  for (final AccentsUTF8 object : AccentsUTF8.values()) {
      setTmp.add(object.toString());
  }
  final EnumSet&lt;AccentsUTF8&gt; esUtf8 = EnumSet.noneOf(AccentsUTF8.class);
  final String[] acc1 = {"é", "à", "u"};
  for (final String string : acc1) {
      if (setTmp.contains(string)) {
          esUtf8.add(AccentsUTF8.valueOf(string));
      } else {
          System.out.println(string + " not an accent.");
      }
  }
  System.out.println(esUtf8.size() + "\t" + esUtf8.toString() 
  </code></pre>
  
  <p>Thanks for attention you paid for.</p>