public static void main(String[] args) {
		// TODO Auto-generated method stub
		Deal deals[] = new Deal[10];
		for(int i = 0 ; i < 10 ; i++ ){
			int type = (int) (Math.random() * 3);
			int amount = (int) (Math.random() * 2000 + 3000);
			int year = (int)(Math.random()*13 + 10);
			int month = (int)(Math.random()*12);
			int day = (int)(Math.random()*29);
			switch(type){
			case 0:
				deals[i] = new NormalDeal(String.valueOf(amount), new String("NormalDeal"), new Date(year, month, day) );
				break;
			case 1:
				int stockNumber = (int)(Math.random()*99999);
				deals[i] = new StockDeal(String.valueOf(amount), 
						"StockDeal", 
						new Date(year, month, day), 
						String.valueOf(stockNumber) );
				break;
			case 2:
				deals[i] = new TransferDeal(String.valueOf(amount), new String("TransferDeal"), new Date(year, month, day) );
				break;
				default:
					System.out.println("Error here");
			}
		}
		
		for( int i = 0 ; i < 10 ; i++ ){
			System.out.println(i + ":" + deals[i].toPlainText());
		}
		
		Arrays.sort( deals );
		System.out.println("Sort by Date :");
		for( int i = 0 ; i < 10 ; i++ ){
			System.out.println(i + ":" + deals[i].toPlainText());
		}
		
		Arrays.sort( deals , new Comparator<Deal>(){

			@Override
			public int compare(Deal o1, Deal o2) {
				// TODO Auto-generated method stub
				return Integer.valueOf(o1.getAmount()) - Integer.valueOf(o2.getAmount());
			}
			
		});
		
		System.out.println("Sort by Amount :");
		for( int i = 0 ; i < 10 ; i++ ){
			System.out.println(i + ":" + deals[i].toPlainText());
		}
	}