CompositeGenotype implements Genotype, Iterable<Entry<K, V>> { public Collection<V> values() { return map.values(); } CompositeGenotype();  CompositeGenotype(Map<K, V> map); @Override int size(); @SuppressWarnings("unchecked") G get(Object key); void put(K key, V value); void clear(); Set<K> keySet(); Collection<V> values(); @Override Iterator<Entry<K, V>> iterator(); @Override @SuppressWarnings("unchecked") G newInstance(); @Override String toString();  }
@Test public void values() { CompositeGenotype<String, Genotype> composite = new CompositeGenotype<String, Genotype>(); Genotype one = new IntegerGenotype(0, 2); Genotype two = new IntegerGenotype(0, 2); composite.put("one", one); composite.put("two", two); Assert.assertEquals(2, composite.values().size()); Assert.assertTrue(composite.values().contains(one)); Assert.assertTrue(composite.values().contains(two)); }