public Domain canonicalize(boolean removeConstants)
    {
        return new Domain(values.canonicalize(removeConstants), nullAllowed);
    }
@Test
    public void testCanonicalize()
            throws Exception
    {
        assertSameDomain(Domain.onlyNull(BIGINT), Domain.onlyNull(BIGINT), false);
        assertSameDomain(Domain.notNull(BIGINT), Domain.notNull(BIGINT), false);

        assertDifferentDomain(Domain.onlyNull(BIGINT), Domain.notNull(BIGINT), false);
        assertDifferentDomain(Domain.onlyNull(BIGINT), Domain.onlyNull(VARCHAR), false);

        assertDifferentDomain(
                Domain.multipleValues(BIGINT, ImmutableList.of(0L, 1L)),
                Domain.multipleValues(BIGINT, ImmutableList.of(0L, 2L)),
                false);

        assertSameDomain(
                Domain.multipleValues(BIGINT, ImmutableList.of(0L, 1L)),
                Domain.multipleValues(BIGINT, ImmutableList.of(0L, 2L)),
                true);

        assertDifferentDomain(
                Domain.multipleValues(BIGINT, ImmutableList.of(0L, 1L)),
                Domain.multipleValues(BIGINT, ImmutableList.of(0L, 1L, 2L)),
                true);
    }