@Test(expected = IllegalArgumentException.class)
public void shouldDetectConflictTasks() throws Exception {

    // given
    tasks.add(new MockUpgradeTask("1.0.0", "one", 1, USER));
    tasks.add(new MockUpgradeTask("1.0.0", "second", 2, USER));
    tasks.add(new MockUpgradeTask("1.2.0", "one", 1, USER));
    tasks.add(new MockUpgradeTask("1.2.0", "second", 2, USER));
    tasks.add(new MockUpgradeTask("1.2.0", "second bis", 2, USER)); // conflict
    tasks.add(new MockUpgradeTask("1.2.0", "third", 3, USER));
    tasks.add(new MockUpgradeTask("1.3.0", "second", 2, USER));
    tasks.add(new MockUpgradeTask("1.3.0", "second bis", 2, USER)); // conflict
    // when
    service.sortAndCheckTasks();
}