### Question:
ObjectIdFunctions { @ScalarFunction @SqlType("timestamp(3) with time zone") public static long objectidTimestamp(@SqlType("ObjectId") Slice value) { int epochSeconds = new ObjectId(value.getBytes()).getTimestamp(); return packDateTimeWithZone(SECONDS.toMillis(epochSeconds), UTC_KEY); } private  ObjectIdFunctions(); @Description("Mongodb ObjectId") @ScalarFunction @SqlType("ObjectId") static Slice objectid(); @Description("Mongodb ObjectId from the given string") @ScalarFunction @SqlType("ObjectId") static Slice objectid(@SqlType(StandardTypes.VARCHAR) Slice value); @ScalarFunction @SqlType("timestamp(3) with time zone") // ObjectId's timestamp is a point in time static long objectidTimestamp(@SqlType("ObjectId") Slice value); @ScalarOperator(CAST) @LiteralParameters("x") @SqlType("varchar(x)") static Slice castToVarchar(@LiteralParameter("x") long x, @SqlType("ObjectId") Slice value);  }### Answer:
@Test public void testObjectidTimestamp() { assertFunction( "objectid_timestamp(ObjectId('1234567890abcdef12345678'))", TIMESTAMP_TZ_MILLIS, toTimestampWithTimeZone(ZonedDateTime.of(1979, 9, 5, 22, 51, 36, 0, UTC))); }