BigIntegerType implements UserType { @Override public boolean equals(final Object x, final Object y) throws HibernateException { if (x == null) { return y == null; } return x.equals(y); }  @Override int[] sqlTypes(); @Override Class returnedClass(); @Override boolean equals(final Object x,
                          final Object y); @Override int hashCode(final Object x); @Override Object nullSafeGet(final ResultSet rs,
                              final String[] names,
                              final SharedSessionContractImplementor session,
                              final Object owner); @Override void nullSafeSet(final PreparedStatement st,
                            final Object value,
                            final int index,
                            final SharedSessionContractImplementor session); @Override Object deepCopy(final Object value); @Override boolean isMutable(); @Override Serializable disassemble(final Object value); @Override Object assemble(final Serializable cached,
                           final Object owner); @Override Object replace(final Object original,
                          final Object target,
                          final Object owner);  }
@Test public void equals() { BigIntegerType type = new BigIntegerType(); BigInteger one = IdUtil.next(); BigInteger two = new BigInteger(one.toByteArray()); BigInteger three = IdUtil.next(); assertTrue(type.equals(one, two)); assertFalse(type.equals(three, two)); assertFalse(type.equals(two, three)); assertTrue(type.equals(null, null)); assertFalse(type.equals(null, two)); assertFalse(type.equals(two, null)); }