public void mergeWith(DynamicFilterStats other)
    {
        if (other == null) {
            return;
        }
        producerNodeIds.addAll(other.getProducerNodeIds());
    }
@Test
    public void testMergeWith()
    {
        final PlanNodeId[] planNodes1 = new PlanNodeId[] {new PlanNodeId("1"), new PlanNodeId("2")};
        Set<PlanNodeId> planNodeSet1 = new HashSet<>(Arrays.asList(planNodes1));
        DynamicFilterStats stats1 = new DynamicFilterStats(planNodeSet1);
        assertEquals(stats1.getProducerNodeIds(), planNodeSet1);

        final PlanNodeId[] planNodes2 = new PlanNodeId[] {new PlanNodeId("2"), new PlanNodeId("3")};
        Set<PlanNodeId> planNodeSet2 = new
                HashSet<>(Arrays.asList(planNodes2));
        DynamicFilterStats stats2 = new DynamicFilterStats(planNodeSet2);
        assertEquals(stats2.getProducerNodeIds(), planNodeSet2);

        stats2.mergeWith(stats1);
        assertEquals(stats1.getProducerNodeIds(), planNodeSet1);
        final Set<PlanNodeId> expectedMergeNodeSet = ImmutableSet.of(new PlanNodeId("1"), new PlanNodeId("2"), new PlanNodeId("3"));
        assertEquals(stats2.getProducerNodeIds(), expectedMergeNodeSet);
        assertFalse(stats2.empty());

        final PlanNodeId[] emptyPlanNodes = new PlanNodeId[] {};
        Set<PlanNodeId> emptyPlanNodeSet = new HashSet<>(Arrays.asList(emptyPlanNodes));
        DynamicFilterStats emptyStats1 = new DynamicFilterStats(emptyPlanNodeSet);
        DynamicFilterStats emptyStats2 = new DynamicFilterStats(emptyPlanNodeSet);
        emptyStats2.mergeWith(emptyStats1);
        assertTrue(emptyStats2.empty());
        assertTrue(emptyStats1.empty());
        assertTrue(emptyStats1.getProducerNodeIds().isEmpty());
        assertTrue(emptyStats2.getProducerNodeIds().isEmpty());
    }