You never define shipment in your TestPackages class. I see you define shipment in the main method of your Packet class; therefore, there is no way for your TestPackages class to reach that variable....