//=================================================================================================
public class UseGenericPair {
//-------------------------------------------------------------------------------------------------
    public static void main(String[] args) {

        GenericPair<Gun> twoGuns;
        GenericPair<Cop> twoCops;

        twoGuns = new GenericPair<>(new Gun("Beretta",10),new Gun("Ruger",12));
        System.out.println("At the start the guns are \n" + twoGuns);
        twoGuns.getElement(1).load();
        System.out.println("After loading 1 the guns are \n" + twoGuns);
        twoGuns.setElement(2,null);
        System.out.println("After deleting 2 the guns are \n" + twoGuns);
        System.out.println();

        twoCops = new GenericPair<>(new Cop("Vic Mackey"),new Cop("Danny Sofer"));
        System.out.println("At the start the cops are \n" + twoCops);
        twoCops.getElement(1).setGun(twoGuns.getElement(1));
        System.out.println("After giving Vic a gun the cops are \n" + twoCops);
    }
//-------------------------------------------------------------------------------------------------
}
//=================================================================================================

