public class KeyValuePairUser // demonstrate several KeyValuePairs and their equals method { @SuppressWarnings("unchecked") // needed because of the equals method calls public static void main(String[] args) { KeyValuePair k1=new KeyValuePair("Name", "Smith"); KeyValuePair k2=new KeyValuePair("Name", "Smythe"); KeyValuePair k3=new KeyValuePair("Occupation", "Smith"); KeyValuePair k4=new KeyValuePair("Occupation", "Smythe"); KeyValuePair k5=new KeyValuePair("Name", "Smythe"); KeyValuePair k6=new KeyValuePair("Height", 71); KeyValuePair k7=new KeyValuePair("Height", 71); System.out.println(KeyValuePair.equal(k1,k2)); System.out.println(KeyValuePair.equal(k3, k4)); System.out.println(KeyValuePair.equal(k1,k3)); System.out.println(KeyValuePair.equal(k2,k5)); System.out.println(KeyValuePair.equal(k6, k7)); } }