public void testPushColumn() {
ColumnSortList list = new ColumnSortList();
assertEquals(0, list.size());
// Push an item.
Column<String, String> col0 = new IdentityColumn<String>(new TextCell());
ColumnSortInfo item0 = list.push(col0);
assertEquals(1, list.size());
assertEquals(item0, list.get(0));
assertEquals(col0, list.get(0).getColumn());
assertTrue(list.get(0).isAscending());
// Push the same item. Should change sort order.
ColumnSortInfo item0desc = list.push(col0);
assertEquals(1, list.size());
assertEquals(item0desc, list.get(0));
assertEquals(col0, list.get(0).getColumn());
assertFalse(list.get(0).isAscending());
// Push a second item.
Column<String, String> col1 = new IdentityColumn<String>(new TextCell());
list.push(col1);
assertEquals(2, list.size());
assertEquals(col1, list.get(0).getColumn());
assertTrue(list.get(0).isAscending());
assertEquals(col0, list.get(1).getColumn());
assertFalse(list.get(1).isAscending());
// Push a third item.
Column<String, String> col2 = new IdentityColumn<String>(new TextCell());
list.push(col2);
assertEquals(3, list.size());
assertEquals(col2, list.get(0).getColumn());
assertTrue(list.get(0).isAscending());
assertEquals(col1, list.get(1).getColumn());