@Test
void merge() throws IncompatibleVersionConstraintException
{

    assertEquals("2.0", new DefaultVersionConstraint("1.0").merge(new DefaultVersionConstraint("2.0")).getValue());
    assertEquals("[2.0]",
        new DefaultVersionConstraint("[1.0,2.0]").merge(new DefaultVersionConstraint("[2.0]")).getValue());
    assertEquals("{[1.0,2.0]},{[2.0,]}",
        new DefaultVersionConstraint("[1.0,2.0]").merge(new DefaultVersionConstraint("2.0")).getValue());
    assertEquals("[2.0]",
        new DefaultVersionConstraint("1.0").merge(new DefaultVersionConstraint("[2.0]")).getValue());
    // Invalid
    Throwable exception = assertThrows(IncompatibleVersionConstraintException.class, () -> {
        new DefaultVersionConstraint("[1.0]").merge(new DefaultVersionConstraint("[2.0]")).getValue();
    });
    assertEquals("Ranges [[1.0]] and [[2.0]] are incompatibles", exception.getMessage());
    exception = assertThrows(IncompatibleVersionConstraintException.class, () -> {
        new DefaultVersionConstraint("[1.0]").merge(new DefaultVersionConstraint("2.0")).getValue();
    });
    assertEquals("Ranges [[1.0]] and [[2.0,]] are incompatibles", exception.getMessage());
}