private static Map < ColorRgba , Collection < TileRef > > convertToColorKey ( Map < TileRef , ColorRgba > tiles ) { final Map < ColorRgba , Collection < TileRef > > colors = new HashMap <> ( ) ; for ( final Map . Entry < TileRef , ColorRgba > entry : tiles . entrySet ( ) ) { final Collection < TileRef > tilesRef = getTiles ( colors , entry . getValue ( ) ) ; tilesRef . add ( entry . getKey ( ) ) ; } return colors ; }
Convert map associating color per tile to tiles per color .