title: Implementing two way connected comboboxes
body: <p>I have a list of Foo objects. Value for activity is different in each objects and same category can be present in several objects. I have two combo boxes in my application UI for category and activity. </p>
  
  <pre><code>public class Foo
  {
    String category;
    String activity;
  }
  </code></pre>
  
  <p>I need to load the category combo box from the available category values in the list of Foo objects. When someone selects a category from combo box, I need to load activity combo box from the values from Foo list that matches the selected category. </p>
  
  <p>If 'all' is selected in category combo box all the activities will be loaded to the activity combo box. When user selects an activity from activity combobox, relevant category value will get loaded to the category combo box.</p>
  
  <p>So it is two way connected. To implement this functionality I thought of using two maps, One that map category as key and activities as values. The other map with activity as key and category as value.</p>
  
  <p>Is there any other way than using 2 maps to implement this functionality?</p>