title: refactoring multiple if-else conditionals in a method
body: <p>I am in the process of refactoring my existing code. It actually works fine, but it is a bit cluttered with multiple if-else conditionals checking the value of one variable and change the value of a second variable to an updated value taken from a fixed enumeration structure.</p>
  
  <pre><code>else if (var1 == 'valueX')
  {
      if (var2 == MyEnum.A)
          var2 = MyEnum.B;
      else if (var2 == MyEnum.B)
          var2 = MyEnum.C;
      else if (var2 == MyEnum.C)
          var2 = MyEnum.D;
      else if (var2 == MyEnum.D)
          var2 = MyEnum.A;
  }
  
  else if (....)
  {
  ..similar block of conditionals
  }
  </code></pre>
  
  <p>I am a bit confused as to what is the best way to refactor and clean-up this code. Would you suggest the use of a switch perhaps? Or something more elegant?</p>
  
  <p>Thanks in advance!</p>