title: Get class instance from enum type
body: <p>I have the <code>Color</code> enum with:</p>
  
  <ol>
  <li><p><code>RED</code></p></li>
  <li><p><code>BLUE</code></p></li>
  <li><p><code>GREEN</code></p></li>
  </ol>
  
  <p>I also have these 3 classes:</p>
  
  <ol>
  <li><p><code>Red</code></p></li>
  <li><p><code>Blue</code></p></li>
  <li><p><code>Green</code></p></li>
  </ol>
  
  <p>My <code>Testclass</code> uses the attribute <code>private Color color</code> and stores one enum value there. How can I return the corresponding class object when calling <code>getValue()</code> or something on <code>private Color color</code>?</p>
  
  <p>Example:
  If my <code>Testclass</code> has <code>color = Color.RED</code>, it should return a new instance of the class <code>Red</code> when calling <code>getValue()</code> on it.</p>