HashMap getAHashMap() { return new HashMap(); } HashMap list = getAHashMap(); list.put("hi", 1); //anyway to not get a warning with this pseudo snippet?