title: Method that converts String to Enum for any Enum
body: <p>I want to create a <code>method</code> that can convert a <code>String</code> to an unspecific <code>enum</code>.
  Here's what I've got so far:</p>
  
  <pre><code>public static Enum&lt;?&gt; toEnum(Class&lt;Enum&gt; targetEnum, String name) {
          return targetEnum.valueOf(targetEnum, name);
  }
  </code></pre>
  
  <p>Something like this...</p>