@Test
public void testGetSortedLevels()
{

    DataApprovalLevel level1 = new DataApprovalLevel( "level1", 1, null );
    level1.setLevel( 1 );
    DataApprovalLevel level2 = new DataApprovalLevel( "level2", 2, null );
    level2.setLevel( 2 );
    DataApprovalLevel level3 = new DataApprovalLevel( "level3", 3, null );
    level3.setLevel( 3 );
    DataApprovalWorkflow workflow = new DataApprovalWorkflow( "test workflow", new DailyPeriodType(), newHashSet(level3, level2, level1 ) );
    List<DataApprovalLevel> levels = workflow.getSortedLevels();
    assertEquals( 1, levels.get( 0 ).getLevel() );
    assertEquals( 2, levels.get( 1 ).getLevel() );
    assertEquals( 3, levels.get( 2 ).getLevel() );
}