Java tutorial
//package com.java2s; import java.util.Map; public class Main { private static void incrementCardCount(Map<String, Integer> map, String blueprintId, int incrementBy) { final Integer oldCount = map.get(blueprintId); if (oldCount == null) map.put(blueprintId, incrementBy); else map.put(blueprintId, oldCount + incrementBy); } }