title: "Type safety: Potential heap pollution via varargs parameter conds"
body: <p>I have a method whose signature is as follows:</p>
  
  <pre><code>public ClaimSearchPage waitForClaimCondition(String header, String value, Pair&lt;String, String&gt;... conds) {
  </code></pre>
  
  <p>My intention is to have them pass in several (potentially different number in each call) of pairs.  Each pair has a key and a value.  This method accesses a grid with headers.  The method loops through all the pairs, and for each key verifies that the value in the cell is the value passed in.  Should make sense?</p>
  
  <p>Eclipse gives me a warning "Type safety: Potential heap pollution via varargs parameter conds".  Typically with Eclipse it underlines the code in yellow and when you hover it gives suggestions to fix the problem.  In this case, the only suggestion it gives is to suppress warnings.  I could do that but that is doing just what it says, suppressing warnings.  The warning will still be there.</p>
  
  <p>I see that this warning can refer to types which are not members of supertypes to which they point but I am unsure what to do?</p>
  
  <p>The call also gives a warning "Type safety: A generic array of Pair is created for a varargs parameter" but also offers no solutions.</p>
  
  <p>I call it like this:</p>
  
  <pre><code> Pair&lt;String, String&gt; cond1 = Pair.of("Status", "Complete");
   Pair&lt;String, String&gt; cond2 = Pair.of("Sub-Status", "Waiting");
   myPage.waitForClaimCondition("Number", "12345", cond1, cond2);
  </code></pre>