/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package generics; /** * * @author steve */ public class GenericMapTest { public static void test(MinGenericMap map) { map.put("Pat",22); map.put("Anthony",35); map.put("Anthony",36); map.put("Betty",27); map.put("Stephan", 57); map.put("Zane", 99); int n = 0; for(String key: map) { System.out.println("name: "+key+", age: "+map.get(key)); n ++; } if(n != map.size()) throw new Error("Bad size"); } }