public SearchSourceBuilder sort(SortBuilder sort){
  if (sorts == null) {
    sorts=new ArrayList<>();
  }
  sorts.add(sort);
  return this;
}

public SearchSourceBuilder sort ( SortBuilder sort ) { if ( sorts == null ) { sorts = new ArrayList < > ( ) ; } sorts . add ( sort ) ; return this ; }
adds a sort builder .
