private < T > ApiFuture < T > extractFirst ( ApiFuture < List < T > > results ) { return ApiFutures . transform ( results , new ApiFunction < List < T > , T > ( ) { @ Override public T apply ( List < T > results ) { return results . isEmpty ( ) ? null : results . get ( 0 ) ; } } ) ; }
Extracts the first result from an ApiFuture with list of results .