title: How to make sure that class sent as parameter has a certain annotation
body: <p>I created a DAL few weeks ago which connects to Mongo Database.</p>
  
  <p>When I want to query the database with a certain class, I need to know collection it belongs.</p>
  
  <p>I thought about creating an annotation, that I'll put above each class which will contain the name of the related collection, and when I'll need to query the database I'll get the annotation value by reflection.</p>
  
  <p>My question is how can I declare that the class that is sent to me has the annotation. </p>
  
  <p>Pretty much like:</p>
  
  <pre><code>public List&lt;T&gt; query(Class&lt;T extends Interface&gt;)
  </code></pre>
  
  <p>only:</p>
  
  <pre><code>public List&lt;T&gt; query(Class&lt;T has Annotation&gt;)
  </code></pre>
  
  <p>Thanks.</p>