@Test
public void testCompareTo() {

	// Create jobs
	ScheduledJob job1 = new ScheduledJob();
	ScheduledJob job2 = new ScheduledJob();
	ScheduledJob job3 = new ScheduledJob();
	ScheduledJob job4 = new ScheduledJob();
	ScheduledJob job5 = new ScheduledJob();
	job3.setJobName( "job3" );
	job4.setJobName( "job4" );
	job5.setJobName( "job5" );
	// Insert them in a list in "the wrong order"
	List<ScheduledJob> jobs = new ArrayList<> ();
	jobs.add( job5 );
	jobs.add( job1 );
	jobs.add( job3 );
	jobs.add( job4 );
	jobs.add( job2 );
	// Sort
	Collections.sort( jobs );
	// Verify the sorting
	Assert.assertEquals( job1, jobs.get( 0 ));
	Assert.assertEquals( job2, jobs.get( 1 ));
	Assert.assertEquals( job3, jobs.get( 2 ));
	Assert.assertEquals( job4, jobs.get( 3 ));
	Assert.assertEquals( job5, jobs.get( 4 ));
}