A Map object lends itself well to using a key rather than a position value to get what you're looking for.
Map objects store information in key/value pairs. In your example, the key is a Group and the value is a List of Contacts. In order for it all to work, your key object must implement the equals(Object object) method.
public class Group {
//lots of really great code that defines a Group
public boolean equals(Object obj) {
if( Object == null ) return false;
if( !(Object instanceof Group) ) return false;
if( this == obj ) return true;
Group compareMe = (Group)obj;
if( this.getId() != null && compareMe.getId() != null && this.getId().equals(compareMe.getId()) ) return true;
return false;
}
}
Then the map.get(Group key) can be used to get what you are looking for.
The real issue is that Maps are not sorted collections. There is no guaranteed order to the way the information is stored there, so you can't really be guaranteed that getting something based on position value 1 will be the same every time.