RandomKey extends AbstractListChromosome<Double> implements PermutationChromosome<T> { public static final List<Double> identityPermutation(final int l) { List<Double> repr = new ArrayList<Double>(l); for (int i=0; i<l; i++) { repr.add((double)i/l); } return repr; } RandomKey(final List<Double> representation);  RandomKey(final Double[] representation); List<T> decode(final List<T> sequence); static final List<Double> randomPermutation(final int l); static final List<Double> identityPermutation(final int l); static List<Double> comparatorPermutation(final List<S> data,
                                                         final Comparator<S> comparator); static List<Double> inducedPermutation(final List<S> originalData,
                                                      final List<S> permutedData); @Override String toString();  }
@Test public void testIdentityPermutation() { DummyRandomKey drk = new DummyRandomKey(RandomKey.identityPermutation(5)); List<String> decoded = drk.decode(Arrays.asList(new String[] {"a", "b", "c", "d", "e"})); Assert.assertEquals("a", decoded.get(0)); Assert.assertEquals("b", decoded.get(1)); Assert.assertEquals("c", decoded.get(2)); Assert.assertEquals("d", decoded.get(3)); Assert.assertEquals("e", decoded.get(4)); }