title: How to remove an element from an array based on a condition? Java
body: <p>I have 2 sources of information from which I obtain different products to show. However, there are repeated (same identifier) and I would like to eliminate those.
  I have a flag which tells me which source I am getting and I would like to eliminate those that have repeated their identifier and the flag in 1.
  This is my array of objects that I get when I finish extracting the sources of information:</p>
  
  <pre><code>[
    {
      "identifier":"10410",
      "sku":"69343",
      "product":"Name 2",
      "flag":2,
      "date":null,
      "price":304.74
    },
    {
      "identifier":"10555",
      "sku":"69343",
      "product":"Period 2",
      "flag":2,
      "date":null,
      "price":304.74
    },
    {
      "identifier":"10410",
      "sku":"69388",
      "product":"Other name 2",
      "flag":1,
      "date":null,
      "price":304.74
    },
    {
      "identifier":"10444",
      "sku":"69341",
      "product":"Other name 3",
      "flag":1,
      "date":null,
      "price":304.74
    }
  ]
  </code></pre>
  
  <p>I try to make this:</p>
  
  <pre><code>[
    {
      "identifier":"10410",
      "sku":"69343",
      "product":"Name 2",
      "flag":2,
      "date":null,
      "price":304.74
    },
    {
      "identifier":"10555",
      "sku":"69343",
      "product":"Period 2",
      "flag":2,
      "date":null,
      "price":304.74
    },
    {
      "identifier":"10444",
      "sku":"69341",
      "product":"Other name 3",
      "flag":1,
      "date":null,
      "price":304.74
    }
  ]
  </code></pre>
  
  <p>Can anybody help me? Or give me advice on how to do it in Java?</p>