title: Mockito Mocking any I18n instance created runtime
body: <p>I have a scenario ,like i am creating i18n object instance dynamically in code. I am using the following code:</p>
  
  <pre><code>public String getLocaleString(Locale locale, SlingHttpServletRequest request){
      final ResourceBundle bundle = request.getResourceBundle(locale);
      I18n i18n = new I18n(bundle);
      return i18n.get("local");
  }
  </code></pre>
  
  <p>Here locale, request I have mocked.  But i18n is created dynamically. so am not able to mock <code>i18n.get("local")</code>. </p>
  
  <p>I tried using: </p>
  
  <pre><code>when(any(I18n.class).get("local")).thenReturn("localizedString")
  </code></pre>
  
  <p>But I am not able to. I am getting NullPointerException in this line. </p>
  
  <p>I would like to use Mockito for mocking this scenario. Can you guys help me please? Thanks.</p>