BloomFilterAlt implements IFilter<E>, Serializable { public static int createHash(String val, Charset charset) { return createHash(val.getBytes(charset)); } BloomFilterAlt(double c, int n, int k);  BloomFilterAlt(int bitSetSize, int expectedNumberOElements);  BloomFilterAlt(double falsePositiveProbability, int expectedNumberOfElements);  BloomFilterAlt(int bitSetSize, int expectedNumberOfFilterElements, int actualNumberOfFilterElements, BitSet filterData); static int createHash(String val, Charset charset); static int createHash(String val); static int createHash(byte[] data); static int[] createHashes(byte[] data, int hashes); @Override boolean equals(Object obj); @Override int hashCode(); double expectedFalsePositiveProbability(); double getFalsePositiveProbability(double numberOfElements); double getFalsePositiveProbability(); int getK(); void clear(); void add(E element); void add(byte[] bytes); double getPercentNonZero(); int getNumNonZero(); void addAll(Collection<? extends E> c); boolean membershipTest(E element); boolean contains(E element); boolean contains(byte[] bytes); boolean containsAll(Collection<? extends E> c); boolean getBit(int bit); void setBit(int bit, boolean value); BitSet getBitSet(); int size(); int count(); int getExpectedNumberOfElements(); double getExpectedBitsPerElement(); double getBitsPerElement();  }
@Test public void testCreateHash_String() throws Exception { System.out.println("createHash"); String val = UUID.randomUUID().toString(); int result1 = BloomFilterAlt.createHash(val); int result2 = BloomFilterAlt.createHash(val); assertEquals(result2, result1); int result3 = BloomFilterAlt.createHash(UUID.randomUUID().toString()); assertNotSame(result3, result2); int result4 = BloomFilterAlt.createHash(val.getBytes("UTF-8")); assertEquals(result4, result1); }
@Test public void testCreateHash_byteArr() throws UnsupportedEncodingException { System.out.println("createHash"); String val = UUID.randomUUID().toString(); byte[] data = val.getBytes("UTF-8"); int result1 = BloomFilterAlt.createHash(data); int result2 = BloomFilterAlt.createHash(val); assertEquals(result1, result2); }