@Test
public void testShuffled() {

    for ( Integer[] perm : perms ) {
        Group group = new Group( "group" );
        for ( Integer i : perm ) {
            Item item = new Item( group,
                                  i );
            group.add( item );
        }
        Activation[] elems = group.getQueue();
        for (Activation elem : elems ) {
            Item item = (Item) elem;
            //        System.out.print( " " + item.getSalience() + "/"  + item.getActivationNumber() + "/" + item.getQueueIndex() );
            if ( item.getQueueIndex() % 2 == 0 ) {
                group.remove( item );
                group.add( item );
            }
        }
        boolean ok = true;
        StringBuilder sb = new StringBuilder( "queue:" );
        for ( int i = max - 1; i >= 0; i-- ) {
            int sal = group.getNext().getSalience();
            sb.append( " " ).append( sal );
            if ( sal != i ) ok = false;
        }
        assertTrue( "incorrect order in " + sb.toString(),
                    ok );
        //      System.out.println( sb.toString() );
    }
}