* --------------------
* Position 0 1 2 3 ... 20
*/
public void reorderMultipleColumnsLargeArrayToEdges() throws Exception {
ColumnReorderLayer reorderLayer = new ColumnReorderLayer(
new BaseDataLayerFixture(20, 20));
List<Integer> fromColumnPositions = Arrays.asList(new Integer[] { 10,
11, 12, 13 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 0);
assertEquals(10, reorderLayer.getColumnIndexByPosition(0));
assertEquals(11, reorderLayer.getColumnIndexByPosition(1));
assertEquals(12, reorderLayer.getColumnIndexByPosition(2));
assertEquals(13, reorderLayer.getColumnIndexByPosition(3));
assertEquals(0, reorderLayer.getColumnIndexByPosition(4));
fromColumnPositions = Arrays.asList(new Integer[] { 8, 9, 10, 11 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 8);
assertEquals(4, reorderLayer.getColumnIndexByPosition(8));
assertEquals(5, reorderLayer.getColumnIndexByPosition(9));
assertEquals(6, reorderLayer.getColumnIndexByPosition(10));
assertEquals(7, reorderLayer.getColumnIndexByPosition(11));
fromColumnPositions = Arrays.asList(new Integer[] { 8, 9, 10, 11 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions,
reorderLayer.getColumnCount());
/*
* System.out.println("\n"); // See output for idea on what is going on
* for (int i = 0; i < reorderLayer.getColumnCount(); i++)
* System.out.println(i + "\t" +
* reorderLayer.getColumnIndexByPosition(i));
*/
assertEquals(7, reorderLayer.getColumnIndexByPosition(19));
assertEquals(6, reorderLayer.getColumnIndexByPosition(18));
assertEquals(5, reorderLayer.getColumnIndexByPosition(17));
assertEquals(4, reorderLayer.getColumnIndexByPosition(16));
}