Here you can find the source of removeColor(Map
private static int removeColor(Map<Integer, Integer> windowColorCountMap, int windowColorCount, int lastColor)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { private static int removeColor(Map<Integer, Integer> windowColorCountMap, int windowColorCount, int lastColor) { boolean removedAColor = false; Integer colorCount = windowColorCountMap.get(lastColor); if (colorCount == 1) removedAColor = true;// w w w .ja va 2s . com windowColorCountMap.put(lastColor, colorCount - 1); return removedAColor ? windowColorCount - 1 : windowColorCount; } }