title: Can we check complicated condition by just using List and its size as in this case?
body: <p>There is a Item table, each item has a maximum of 3 different actions (act1, act2, act3), but some item only has 1 or 2 acts. Also, some item has duplicated act like item #2 has 2 entries of act3.</p>
  
  <pre>
  ItemID - ActionID
  1 - act1
  1 - act2
  1 - act3
  2 - act1
  2 - act3
  2 - act3
  3 - act1
  3 - act3
  </pre>
  
  <p>Let say we have a method to <code>getItemInfo(List&lt;Integer&gt; itemList)</code> to get result of item Info, the condition is that the result is only valid if each item containing all 3 acts &amp; all items in the itemList must be appear in the result &amp; finally there is no duplicated in the result.</p>
  
  <pre><code>List&lt;Integer&gt; itemList=new ArrayList&lt;Integer&gt;();
  itemList.add(1);
  itemList.add(3);
  </code></pre>
  
  <p>then run <code>getItemInfo(List&lt;Integer&gt; itemList)</code></p>
  
  <p>The Result will be valid (met all the conditions) like this example :</p>
  
  <pre>
  1 - act1
  1 - act2
  1 - act3
  3 - act1
  3 - act2
  3 - act3
  </pre>
  
  <p>The Result will be invalid like this example (cos item #1 does not contain act3:</p>
  
  <pre>
  1 - act1
  1 - act2
  3 - act1
  3 - act2
  3 - act3
  </pre>
  
  <p>The Result will be invalid like this example (cos item #1 contains duplicates act2):</p>
  
  <pre>
  1 - act1
  1 - act2
  1 - act2
  1 - act3
  3 - act1
  3 - act2
  3 - act3
  </pre>
  
  <p>The Result will be invalid like this example (cos the result does not contain item#3):</p>
  
  <pre>
  1 - act1
  1 - act2
  1 - act3
  </pre>
  
  <p>So here is 1 solution, that is i put all the result in the List and check duplicated, then I check the size, ex:</p>
  
  <pre><code>//run via loop to put all result into a `List&lt;String[]&gt; resultList` 
  &amp; this `resultList` contains `String[]` like    
  String[] s1={"1","act1"}
  String[] s2={"1","act2"}
  .....
  </code></pre>
  
  <p>Then</p>
  
  <pre><code>    if(!MyValidation.isDuplicated(resultList) &amp;&amp; 
         resultList.size()==3*itemList.size() ){
            System.out.println("valid");
      }
      else{
           System.out.println("not valid");
      }
  </code></pre>
  
  <p>My simple question is that, Can <code>if(!MyValidation.isDuplicated(resultList) &amp;&amp; 
         resultList.size()==3*itemList.size() ){}</code> be used for checking all the conditions mentioned above?</p>