@Test public void testGetKeys() { List<MockObject> keys = new ArrayList<>(); MockObject m1 = new MockObject(1); MockObject m2 = new MockObject(2); keys.add(m1); keys.add(m2); DoubleMapGenotype<MockObject> doubleMapGeno = new DoubleMapGenotype<>(keys, new MockBounds()); Collection<MockObject> ks = doubleMapGeno.getKeys(); assertEquals(2, ks.size()); assertTrue(ks.contains(m1)); assertTrue(ks.contains(m2)); }
@Override public Collection<K> getKeys() { return Collections.unmodifiableList(keys); }
DoubleMapGenotype extends DoubleGenotype implements MapGenotype<K, Double> { @Override public Collection<K> getKeys() { return Collections.unmodifiableList(keys); } }
DoubleMapGenotype extends DoubleGenotype implements MapGenotype<K, Double> { @Override public Collection<K> getKeys() { return Collections.unmodifiableList(keys); } DoubleMapGenotype(List<K> keys, Bounds<Double> bounds); }
DoubleMapGenotype extends DoubleGenotype implements MapGenotype<K, Double> { @Override public Collection<K> getKeys() { return Collections.unmodifiableList(keys); } DoubleMapGenotype(List<K> keys, Bounds<Double> bounds); void init(Random random); @Override void init(Random random, int n); @Override boolean containsKey(K key); @Override Double getValue(K key); @Override void setValue(K key, Double value); @Override @SuppressWarnings({ "unchecked", "rawtypes" }) G newInstance(); @Override String toString(); @Override int getIndexOf(K key); @Override Collection<K> getKeys(); }
DoubleMapGenotype extends DoubleGenotype implements MapGenotype<K, Double> { @Override public Collection<K> getKeys() { return Collections.unmodifiableList(keys); } DoubleMapGenotype(List<K> keys, Bounds<Double> bounds); void init(Random random); @Override void init(Random random, int n); @Override boolean containsKey(K key); @Override Double getValue(K key); @Override void setValue(K key, Double value); @Override @SuppressWarnings({ "unchecked", "rawtypes" }) G newInstance(); @Override String toString(); @Override int getIndexOf(K key); @Override Collection<K> getKeys();  }