@Test
public void createOrderExpression()
{

    final Property property1 = new Property();
    property1.setName( "value1" );
    property1.setSimple( true );
    property1.setPersisted( true );
    final Property property2 = new Property();
    property2.setName( "value2" );
    property2.setSimple( true );
    property2.setPersisted( false );
    final Property property3 = new Property();
    property3.setName( "value3" );
    property3.setSimple( true );
    property3.setKlass( Integer.class );
    property3.setPersisted( true );
    final Property property4 = new Property();
    property4.setName( "value4" );
    property4.setSimple( true );
    property4.setPersisted( true );
    property4.setKlass( String.class );
    final Property property5 = new Property();
    property5.setName( "value5" );
    property5.setSimple( true );
    property5.setPersisted( true );
    Assert.assertEquals( "value1 asc,value3 asc,lower(value4) asc,value5 desc", JpaQueryUtils.createOrderExpression( Arrays.asList(
        new Order( property1, Direction.ASCENDING ),
        new Order( property2, Direction.ASCENDING ),
        new Order( property3, Direction.ASCENDING ).ignoreCase(),
        new Order( property4, Direction.ASCENDING ).ignoreCase(),
        new Order( property5, Direction.DESCENDING )
    ), null ) );
}