CalendarTimestampType implements UserType { @Override public Object assemble(final Serializable cached, final Object owner) throws HibernateException { Long timeInMillis = (Long) cached; Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); calendar.setTimeInMillis(timeInMillis); return calendar; }  @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 assemble() { CalendarTimestampType type = new CalendarTimestampType(); Calendar one = Calendar.getInstance(); Calendar result = (Calendar) type.assemble(one.getTimeInMillis(), null); assertTrue(one.equals(result)); }