lookup suggestions sorted alphabetically if weights are not constant . this is a workaround : in general , use constant weights for alphabetically sorted result . concode_field_sep int bucket concode_elem_sep boolean higherWeightsFirst concode_elem_sep FST<Object> automaton concode_elem_sep int DEFAULT_BUCKETS concode_elem_sep Arc<Object>[] rootArcs concode_elem_sep BytesRef utf8 concode_elem_sep ArrayList<Completion> EMPTY_RESULT concode_elem_sep boolean exactFirst concode_field_sep List<Completion> lookup concode_elem_sep int getBucket concode_elem_sep Arc<Object>[] cacheRootArcs concode_elem_sep ArrayList<Completion> lookupSortedByWeight concode_elem_sep boolean checkExistingAndReorder concode_elem_sep int getExactMatchStartingFromRootArc concode_elem_sep boolean descendWithPrefix concode_elem_sep FST<Object> getFST concode_elem_sep String toString concode_elem_sep int compareTo concode_elem_sep int getBucketCount concode_elem_sep boolean collect
List < Completion > function ( BytesRef arg0 , int arg1 ) { List < Completion > loc0 = lookupSortedByWeight ( arg0 , arg1 , true ) ; Collections . sort ( loc0 ) ; if ( loc0 . size ( ) > arg1 ) { loc0 = loc0 . subList ( 0 , arg1 ) ; } return loc0 ; }