@Test
  public void testTimestampSerialization() throws Exception {
    // There is a kryo which after serialize/deserialize,
    // Timestamp becomes Date. We get around this issue in
    // SearchArgumentImpl.getLiteral. Once kryo fixed the issue
    // We can simplify SearchArgumentImpl.getLiteral
    Timestamp now = new Timestamp(new java.util.Date().getTime());
    SearchArgument sarg =
      SearchArgumentFactory.newBuilder()
        .startAnd()
        .lessThan("x", PredicateLeaf.Type.TIMESTAMP, now)
        .end()
        .build();

    String serializedSarg = sargToKryo(sarg);
    SearchArgument sarg2 = ConvertAstToSearchArg.create(serializedSarg);

    Field literalField = PredicateLeafImpl.class.getDeclaredField("literal");
    literalField.setAccessible(true);
    assertTrue(literalField.get(sarg2.getLeaves().get(0)) instanceof java.util.Date);
    Timestamp ts = (Timestamp)sarg2.getLeaves().get(0).getLiteral();
    assertEquals(ts, now);
  }
Create a predicate leaf. This is used by another test.
ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java