Buggy code:
public class TimeBoundaryQueryQueryToolChest extends QueryToolChest < Result < TimeBoundaryResultValue > , TimeBoundaryQuery > { private static final byte TIMEBOUNDARY_QUERY = 3 ; private static final TypeReference < Result < TimeBoundaryResultValue > > TYPE_REFERENCE = new TypeReference < Result < TimeBoundaryResultValue > > ( ) { } ; private static final TypeReference < Object > OBJECT_TYPE_REFERENCE = new TypeReference < Object > ( ) { } ; @ Override public < T extends LogicalSegment > List < T > filterSegments ( TimeBoundaryQuery query , List < T > segments ) { } @ Override public QueryRunner < Result < TimeBoundaryResultValue > > mergeResults ( final QueryRunner < Result < TimeBoundaryResultValue > > runner ) { } @ Override public Sequence < Result < TimeBoundaryResultValue > > mergeSequences ( Sequence < Sequence < Result < TimeBoundaryResultValue > > > seqOfSequences ) { } @ Override public Sequence < Result < TimeBoundaryResultValue > > mergeSequencesUnordered ( Sequence < Sequence < Result < TimeBoundaryResultValue > > > seqOfSequences ) { } @ Override public Builder makeMetricBuilder ( TimeBoundaryQuery query ) { } @ Override public Function < Result < TimeBoundaryResultValue > , Result < TimeBoundaryResultValue > > makePreComputeManipulatorFn ( TimeBoundaryQuery query , MetricManipulationFn fn ) { } @ Override public TypeReference < Result < TimeBoundaryResultValue > > getResultTypeReference ( ) { } @ Override public CacheStrategy < Result < TimeBoundaryResultValue > , Object , TimeBoundaryQuery > getCacheStrategy ( TimeBoundaryQuery query ) { return new CacheStrategy < Result < TimeBoundaryResultValue > , Object , TimeBoundaryQuery > ( ) { @ Override public byte [ ] computeCacheKey ( TimeBoundaryQuery query ) { final byte [ ] cacheKey = query . getCacheKey ( ) ; return ByteBuffer . allocate ( ( 1 + ( cacheKey . length ) ) ) . put ( TimeBoundaryQueryQueryToolChest . TIMEBOUNDARY_QUERY ) . put ( cacheKey ) . array ( ) ; } @ Override public TypeReference < Object > getCacheObjectClazz ( ) { return TimeBoundaryQueryQueryToolChest . OBJECT_TYPE_REFERENCE ; } @ Override public Function < Result < TimeBoundaryResultValue > , Object > prepareForCache ( ) { return new Function < Result < TimeBoundaryResultValue > , Object > ( ) { @ Override public Object apply ( Result < TimeBoundaryResultValue > input ) { return Lists . newArrayList ( input . getTimestamp ( ) . getMillis ( ) , input . getValue ( ) ) ; } } ; } @ Override public Function < Object , Result < TimeBoundaryResultValue > > pullFromCache ( ) { return new Function < Object , Result < TimeBoundaryResultValue > > ( ) { @ Override @ SuppressWarnings ( "unchecked" ) public Result < TimeBoundaryResultValue > apply ( Object input ) { List < Object > result = ( ( List < Object > ) ( input ) ) ; <START_BUG> return new Result ( new DateTime ( result . get ( 0 ) ) , new TimeBoundaryResultValue ( result . get ( 1 ) ) ) ; <END_BUG> } } ; } @ Override public Sequence < Result < TimeBoundaryResultValue > > mergeSequences ( Sequence < Sequence < Result < TimeBoundaryResultValue > > > seqOfSequences ) { return new com . metamx . common . guava . MergeSequence ( getOrdering ( ) , seqOfSequences ) ; } } ; } public Ordering < Result < TimeBoundaryResultValue > > getOrdering ( ) { } }

Fix:
return new Result ( new DateTime ( ( ( Number ) ( result . get ( 0 ) ) ) . longValue ( ) ) , new TimeBoundaryResultValue ( result . get ( 1 ) ) ) ;