Added because it is needed by the BinaryEncoder.
Added method exists(T obj).
Added some assert methods to verify the outcome of the test case methods.