Java code simulating a "prisoners dilemma" problem