public static Builder withMaximumSizeBytes(long maxBloomFilterSizeBytes) {
    checkArgument(maxBloomFilterSizeBytes > 0, "Expected Bloom filter size limit to be positive.");
    long optimalNumberOfElements =
        optimalNumInsertions(maxBloomFilterSizeBytes, DEFAULT_FALSE_POSITIVE_PROBABILITY);
    checkArgument(
        optimalNumberOfElements <= MAX_ELEMENTS,
        "The specified size limit would attempt to create a Bloom filter builder larger than "
            + "the maximum supported size of 2^63.");

    return withMaximumNumberOfInsertionsForOptimalBloomFilter(optimalNumberOfElements);
  }
@Test
  public void testBuilderWithMaxSize() throws Exception {
    ScalableBloomFilter.Builder builder = ScalableBloomFilter.withMaximumSizeBytes(MAX_SIZE);

    int maxValue = insertAndVerifyContents(builder, (int) (MAX_SIZE * 1.1));

    ScalableBloomFilter bloomFilter = builder.build();

    // Verify that the decoded value contains all the values and that it is much smaller
    // than the maximum size.
    verifyCoder(bloomFilter, maxValue, MAX_SIZE);
  }