1 package com.test; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 /*This class had been set to trigger on December 21, 2012. 7 *Due to a programming this class will trigger off in the next 15 mins 8 *of you reading it. 9 *Yes its a know issue and we've sorry about it, but right now there are other major 10 *issues to solve and this can wait for later! 11 **/ 12 public class DoomsDayEarth 13 { 14 /*No point in returning anything once the world has been destroyed!*/ 15 public static void destroyWorld(List<EvilObject> evilObjects) 16 { 17 /*You do get a chance to save the world. Try it!*/ 18 Hope.save(evilObjects); 19 20 /*This code destroys the world and prints world destroyed. 21 *Prevent that from happening and if possible get it to print world saved 22 * */ 23 for(Destroy d : evilObjects) 24 { 25 d.destroy(); 26 } 27 } 28 29 public static void main(String[] args) { 30 List<EvilObject> evil = new ArrayList<EvilObject>(); 31 evil.add(new EvilObject()); 32 DoomsDayEarth.destroyWorld(evil); 33 } 34 } 35 36 /*This is the only class that you can modify. Whatever happens there is always Hope!*/ 37 class Hope 38 { 39 /*Write some code here that will save the world. Remember you just have 15 mins 40 *to save the world, before main starts up, so be quick. 41 **/ 42 public static void save(List<EvilObject> evilObjects) 43 { 44 } 45 } 46 47 interface Destroy{ 48 void destroy(); 49 } 50 51 class EvilObject implements Destroy 52 { 53 public void destroy() 54 { 55 //This method has the power to destroy the world! 56 //To prevent any possible misuse, the code has been censored 57 //and is not published on twisters! 58 System.out.println("The world is destroyed!"); 59 } 60 } 61 62 class GoodObject implements Destroy 63 { 64 public void destroy() 65 { 66 //This method does nothing. Its sole purpose is to replicate the EvilObject 67 //without doing any evil!! 68 System.out.println("The world is saved!"); 69 } 70 }