@Test(expected = IllegalArgumentException.class) public void testInvalidKeyGetIndex() { BooleanMapGenotype<Integer> geno = new BooleanMapGenotype<>(new MockList()); geno.getIndexOf(3); }
@Override public int getIndexOf(K key) { if (!containsKey(key)) { throw new IllegalArgumentException(ERROR_MESSAGE_INVALID_KEY); } return list.indexOf(key); }
BooleanMapGenotype extends BooleanGenotype implements MapGenotype<K, Boolean> { @Override public int getIndexOf(K key) { if (!containsKey(key)) { throw new IllegalArgumentException(ERROR_MESSAGE_INVALID_KEY); } return list.indexOf(key); } }
BooleanMapGenotype extends BooleanGenotype implements MapGenotype<K, Boolean> { @Override public int getIndexOf(K key) { if (!containsKey(key)) { throw new IllegalArgumentException(ERROR_MESSAGE_INVALID_KEY); } return list.indexOf(key); } BooleanMapGenotype(List<K> list); }
BooleanMapGenotype extends BooleanGenotype implements MapGenotype<K, Boolean> { @Override public int getIndexOf(K key) { if (!containsKey(key)) { throw new IllegalArgumentException(ERROR_MESSAGE_INVALID_KEY); } return list.indexOf(key); } BooleanMapGenotype(List<K> list); void init(Random random); @Override void init(Random random, int n); @Override Boolean getValue(K key); @Override void setValue(K key, Boolean value); @Override boolean containsKey(K key); @Override @SuppressWarnings({ "unchecked", "rawtypes" }) G newInstance(); @Override String toString(); @Override int getIndexOf(K key); @Override Collection<K> getKeys(); }
BooleanMapGenotype extends BooleanGenotype implements MapGenotype<K, Boolean> { @Override public int getIndexOf(K key) { if (!containsKey(key)) { throw new IllegalArgumentException(ERROR_MESSAGE_INVALID_KEY); } return list.indexOf(key); } BooleanMapGenotype(List<K> list); void init(Random random); @Override void init(Random random, int n); @Override Boolean getValue(K key); @Override void setValue(K key, Boolean value); @Override boolean containsKey(K key); @Override @SuppressWarnings({ "unchecked", "rawtypes" }) G newInstance(); @Override String toString(); @Override int getIndexOf(K key); @Override Collection<K> getKeys();  }