title: Java Set Testing
body: <p>I have a Java Object that contains another java object that is a set. For Example:</p>
  
  <pre><code>Public States {
        private Set&lt;City&gt; cities = new HashSet(0);
         // Setters and Getters Here
        }
  
   Public City {
        private String dummyValue;
        // Setters and Getters Here
        }
  </code></pre>
  
  <p>I would like to test this object to ensure it contains values that I have modified in a method. For example I was trying:</p>
  
  <pre><code>Set&lt;City&gt; citySet = citySetInfoFromAnotherMethod;
  assert citySet.iterator().next().equals("Dallas");
  </code></pre>
  
  <p>However I know this will not work because a Set does not have an order such as a list does.</p>
  
  <p>So in conclusion, in what way can I test this object to see if values another method assigns to it appear after I do something to it.</p>