question: public void sortPalettes ( Comparator < Integer > comparator ) { for ( String key : mColorPaletteMap . keySet ( ) ) { ArrayList < Integer > palette = mColorPaletteMap . get ( key ) ; Integer [ ] sortedColors = new Integer [ palette . size ( ) ] ; Arrays . sort ( palette . toArray ( sortedColors ) , comparator ) ; palette . clear ( ) ; for ( Integer color : sortedColors ) { palette . add ( color ) ; } mColorPaletteMap . put ( key , palette ) ; } }
target:  Sorts the arrays of colors based on a comparator.