title: Java - avoid switch statements for static functions
body: <p>Check out this code - </p>
  
  <pre><code>switch(kind) {
       case "green" :
             GreenKind.doSomething(); // Static function
       break;
       case "white" :
             WhiteKind.doSomething(); // Static function
       break;
       case "blue" :
             BlueKind.doSomething(); // Static function
       break;
       case "yellow" :
             YellowKind.doSomething(); // Static function
       break;
  }
  </code></pre>
  
  <p>There is a way to avoid the switch statement? as it smells real bad.</p>
  
  <p>Maybe to somethnig like this? -</p>
  
  <pre><code>kinds.get(kind).doSomething();
  </code></pre>
  
  <p>The problem with my solution is that the functions are static, and i can't implement an interface with static functions. If you didn't understood why i wrote interface its because i wanted to use polymorphism in my solution above.</p>