title: How to eliminate duplicate entries within a stream based on a own Equal class
body: <p>I do have a simialar problem like descripted <a href="https://stackoverflow.com/questions/6680157/how-to-remove-duplicate-objects-in-a-listmyobject-without-equals-hashcode">here</a>. But with two differences first I do use the stream api and second I do have an <code>equals()</code> and <code>hashCode()</code> method already. But within the stream the equalitity of the of Blogs are in this context not the same as defined in the <code>Blog</code> class.</p>
  
  <pre><code>Collection&lt;Blog&gt; elements = x.stream()
      ... // a lot of filter and map stuff
      .peek(p -&gt; sysout(p)) // a stream of Blog
      .? // how to remove duplicates - .distinct() doesn't work
  </code></pre>
  
  <p>I do have a class with an equal Method lets call it <code>ContextBlogEqual</code> with the method </p>
  
  <pre><code>public boolean equal(Blog a, Blog b);
  </code></pre>
  
  <p>Is there any way removing all duplicate entries with my current stream approach based on the <code>ContextBlogEqual#equal</code> method?</p>
  
  <p>I thought already on grouping, but this doesn't work either, because the reason why <code>blogA</code> and <code>blogB</code> is equal isn't just one parameter. Also I have no idea how I could use .reduce(..), because there is useally more than one element left. </p>