Permutation { public Permutation multiply(Permutation other) { Permutation newPermutation = new Permutation(values.length); for (int i = 0; i < values.length; i++) { newPermutation.values[i] = this.values[other.values[i]]; } return newPermutation; } Permutation(int size);  Permutation(int... values);  Permutation(Permutation other); @Override boolean equals(Object other); @Override int hashCode(); boolean isIdentity(); int size(); int get(int index); int[] getValues(); int firstIndexOfDifference(Permutation other); List<Integer> getOrbit(int element); void set(int index, int value); void setTo(Permutation other); Permutation multiply(Permutation other); Permutation invert(); String toCycleString(); @Override String toString();  }
@Test public void multiplyTest() { int[] valuesA = new int[]{1, 0, 2, 3}; int[] valuesB = new int[]{0, 1, 3, 2}; int[] expectC = new int[]{1, 0, 3, 2}; Permutation a = new Permutation(valuesA); Permutation b = new Permutation(valuesB); Permutation c = new Permutation(expectC); Assert.assertEquals(c, a.multiply(b)); }