public Filter merge(Filter... filters) {
        BloomFilter merged = new BloomFilter(this.getHashCount(), (BitSet) this.filter().clone());

        if (filters == null) {
            return merged;
        }

        for (Filter filter : filters) {
            if (!(filter instanceof BloomFilter)) {
                throw new IllegalArgumentException("Cannot merge filters of different class");
            }
            BloomFilter bf = (BloomFilter) filter;
            merged.addAll(bf);
        }

        return merged;
    }
@Test(expected=IllegalArgumentException.class)
    public void testMergeException() {
        BloomFilter bf3 = new BloomFilter(ELEMENTS*10, 1);
        BloomFilter[] bfs = new BloomFilter[1];
        bfs[0] = bf;
        BloomFilter mergeBf = (BloomFilter) bf3.merge(bf);
    }