add sort utility method; add indexer test case