title: Alternative to Nested Switch Statements in Java
body: <p>So I wrote a method today that incorporated the use of nested switch statements, and the code looked fairly clean and concise to me, but I was told that nested switch statements are not typically the best way to go as they can get confusing with the more switch statements that you add on. Here is a sample of what my code looked like:</p>
  
  <pre><code>EnumOne enumOne;
  EnumTwo enumTwo = null;
  EnumTwo enumThree = null;
  
  switch (enumOne) {
     case CASE_ONE:
  
        switch (enumTwo){
           case A: enumTwo = EnumTwo.B; break;
           case C: enumTwo = EnumTwo.D; break;
           default: break;
        }
  
        switch (enumThree) {
           case AA: enumThree = EnumTwo.BB; break;
           case CC: enumThree = EnumTwo.DD; break;
           default: break;
        }
  
        break;
  
     case CASE_TWO:
     case CASE_THREE:
  
        switch(EnumTwo) {
           default: break;
        }
  
        switch (enumThree) {
           case AA: enumThree = EnumTwo.XX; break;
           case CC: enumThree = EnumTwo.YY; break;
           default: break;
        }
  
        break;
  
     default:
        break;
  }
  </code></pre>
  
  <p>So my question would be, essentially, what would be a suitable alternative to these switch statements?</p>