    @Test
    public void testMerge() {

        Range<Integer> range;

        (range = range(-10, 10)).merge(range(-20, -11));
        assertEquals(range(-20, 10), range);

        (range = range(-10, 10)).merge(range(-20, -10));
        assertEquals(range(-20, 10), range);

        (range = range(-10, 10)).merge(range(-10, 10));
        assertEquals(range(-10, 10), range);

        (range = range(-10, 10)).merge(range(-1, 1));
        assertEquals(range(-10, 10), range);

        (range = range(-10, 10)).merge(range(10, 20));
        assertEquals(range(-10, 20), range);

        (range = range(-10, 10)).merge(range(11, 20));
        assertEquals(range(-10, 20), range);

        (range = range(-10, 10)).merge(range(-20, 20));
        assertEquals(range(-20, 20), range);
    }