title: Store and call method from a HashMap
body: <p>I have 2 files: ImplementationProvider and CaseHandler.</p>
  
  <p>ImplementationProvider:</p>
  
  <pre><code>class ImplementationProvider {
      public void method1(Object[] params) {}
      public void method2(Object[] params) {}
      ...
      public void method100(Object[] params) {}
  }
  </code></pre>
  
  <p>CaseHandler:</p>
  
  <pre><code>class CaseHandler {
      ImplementationProvider ip; // auto injected
      public void handle(String s, String param) {
          switch(s) {
              case USE_CASE_ONE: ip.method1(param); break;
              case USE_CASE_TWO: ip.method2(param); break;
              ...
          }
      }   
  }
  </code></pre>
  
  <p>How can I refactor the CaseHandler so that the USE_CASE strings are keys in a HashMap where the values would be the methods? The main issue I'm having is the propagation of the parameters. Other answers here recommend using an interface, however I need to provide the parameter on runtime.</p>