Hashing an arbitrary object to a sparse array of bits
Wasting space?
I don't know if there's a better way of generating your hashed bits, but you are using 32x the amount of space that you need to.  I would suggest using all the bits in your keys array rather than just 1 bit per int.
What is l for?
One thing I don't understand about your hash is the use of l.  You are already using random numbers to generate your hash, so why do you need to add two random numbers together?  Is it supposed to generate more randomness?  I don't think it does.
An example of packing the bits
// Only allocate one int for every 32 bits.
keys = new int[(size+31)/32];
for(int i=0;i&lt;bpe;i++){
    int bitNum = (r.nextInt(size)+l)%size;
    keys[bitNum &gt;&gt; 5] |= (1 &lt;&lt; (bitNum &amp; 31));
}

To retrieve the bit, previously, you would do:
isBitSet = keys[bitNum] != 0;

Now you would do:
isBitSet = (keys[bitNum &gt;&gt; 5] &amp; (1 &lt;&lt; (bitNum &amp; 31))) != 0;