Java tutorial
//package com.java2s; import java.util.Map; public class Main { public static <T> T getMapValue(Map<? extends Object, T> args, Object key, T defaultValue) { if (args.containsKey(key)) { return args.get(key); } else { return defaultValue; } } }