TableUtilities { public static int[] ordinalsOf(Enum<?>... values) { int[] cols = new int[values.length]; for (int i = 0; i < values.length; i++) { cols[i] = values[i].ordinal(); } return cols; } private  TableUtilities(); static boolean isDataChanged(TableModelEvent e); static boolean isUpdate(TableModelEvent e); static boolean isInsert(TableModelEvent e); static boolean isDelete(TableModelEvent e); static boolean isStructureChanged(TableModelEvent e); static int getPreferredRowHeight(JTable table, int row); static void setPreferredRowHeight(JTable table, int row); static void setPreferredRowHeights(JTable table); static int[] ordinalsOf(Enum<?>... values); static void clear(TableColumnModel model, boolean includeHidden);  }
@Test public void testOrdinals() { int[] ordinals = ordinalsOf(Dummy.THIRD, Dummy.SECOND, Dummy.FIRST); for (int i = 0; i < ordinals.length; i++) { assertEquals(Dummy.values().length - 1 - i, ordinals[i]); } }
@Test public void testOrdinalsEmpty() { int[] ordinals = ordinalsOf(); assertNotNull(ordinals); assertEquals(0, ordinals.length); }