title: Checking method template parameter type
body: <p>I have the following method:</p>
  <pre class="lang-java prettyprint-override"><code>&lt;T&gt; String getBeanStrategyName(Store baseStoreModel, T clazz) {
      if (clazz instanceof PointsStrategy) {
          return baseStoreModel.getPointsStrategy();
      } else if (clazz instanceof RedemptionStrategy) {
          return baseStoreModel.getRedemptionStrategy();
      } else {
          return baseStoreModel.getPointsStrategy();
      }
  }
  </code></pre>
  <p>However when I call the method like this <code>getBeanStrategyName(store,PointsStrategy.class)</code>, the check <code>clazz instanceof PointsStrategy</code> returns false. I need somehow to check the passsed type  and based on it return particular strategy</p>