Java Mockito how to set new value for property
<p>I have <code>Filter</code> mock object and pass it to testing method. It method change <code>Filter</code> meta property value. But in my test I get old value.</p>

<blockquote>
  <p>org.junit.ComparisonFailure: expected:item[28140f6f5a] but was:item[3abf441213]
      at org.junit.Assert.assertEquals(Assert.java:115)
      ...</p>
</blockquote>

<pre><code>@Test
public void testMetaValue() throws Exception{
    when(f.getMetaData("last")).thenReturn("item3abf441213");

    WebUK at = new WebUK();
    at.setCollectingService(new TestCollectingServiceImpl());

    Set&lt;Ad&gt; ads = at.getNewAds(f);
    assertEquals(1, ads.size());
    assertEquals("item28140f6f5a",f.getMetaData("last"));
} 
</code></pre>

<p>Object for test:</p>

<pre><code>public Set&lt;Ad&gt; getNewAds(Filter filter) throws Exception {
        ...
        filter.setMetaData("last", ul.get(0).attr("id"));
        ...
}
</code></pre>