title: How to remove Duplicated elements from a List based on Two properties using Java 8 streams?
body: <p>I'm trying to figure out how to write a stream in Java 8 that removes duplicate records based on a property and a condition, for example:</p>
  <pre><code>+----+------------------+--------------+
  | ID |       Name       |    Value     |
  +----+------------------+--------------+
  |  1 | Real Name        | Real Value   |
  |  2 | Duplicate Name   | Real Value   |
  |  3 | Duplicate Name   | NULL         |
  |  4 | Duplicate Name   | NULL         |
  |  5 | Real Name 2      | Real Value 2 |
  |  6 | Duplicate Name 2 | Real Value   |
  |  7 | Duplicate Name 2 | NULL         |
  +----+------------------+--------------+
  </code></pre>
  <p>Example object:</p>
  <pre><code>Class ExampleObject {
    int id;
    String name;
    String value;
  }
  </code></pre>
  <p>It should remove all the duplicate records with the same name and having <code>value == null</code>.</p>
  <p>So in this case, it should remove records with ID <code>3</code>, <code>4</code>, and <code>7</code>.</p>
  <p>I can solve this by doing a little bit of streams and some <code>for</code> loops, but I don't really like the implementation, knowing it should be possible by having one stream.</p>
  <p>How can I resolve this issue?</p>