//Example of how somebody might use the elevator class: public class BadTestElevator { public static void main(String args[]) { BadElevator el = new BadElevator(); el.doorOpen = true; //passengers get on el.doorOpen = false; //doors close el.floor--; //go down to floor 0 //(below bottom of building) el.floor++; el.floor = 7; //jump to floor 7 - (only 5 floors in building) el.doorOpen = true; //passengers get on/off el.doorOpen = false; el.floor = 1; //plummit to the first floor el.doorOpen = true; //passengers get on/off el.floor++; //elevator moves with door open el.doorOpen = false; el.floor--; el.floor--; } } //All of the problems would be impossible to cause if program had proper //encapsulation and error checking in the elevator