import java.util.*;

public class Deck
{
    public static final int SIZE_OF_DECK = 10007;

    public Deck (boolean debug)
    {
        this(debug, true);
    }

    public Deck (boolean debug, boolean populateDeck)
    {
        _theDeck = new Vector<Integer>(SIZE_OF_DECK);
        _debug = debug;

        if (populateDeck)
            populateWithCards();
        else
            initialise();
    }

    public void dealInto (Deck recipient)
    {
        for (int i = 0; i < SIZE_OF_DECK; i++)
        {
            recipient._theDeck.set(SIZE_OF_DECK -1 -i, _theDeck.elementAt(i));
        }
    }

    public String toString ()
    {
        String str = "Deck: ";

        for (int i = 0; i < SIZE_OF_DECK; i++)
            str += "\n"+_theDeck.elementAt(i);

        return str;
    }

    private void initialise ()
    {
        for (int i = 0; i < SIZE_OF_DECK; i++)
            _theDeck.add(i, -1);
    }

    private void populateWithCards ()
    {
        for (int i = 0; i < SIZE_OF_DECK; i++)
            _theDeck.add(i, i);
    }

    private Vector<Integer> _theDeck;
    private boolean _debug;
}
@@ -66,24 +66,36 @@
 int SIZE_OF_
+SPACE_CARDS_
 DECK = 10007
@@ -114,29 +114,16 @@
 c Deck (
-boolean debug
 )%0A    %7B%0A
@@ -139,81 +139,93 @@
 his(
-debug, true);%0A    %7D%0A%0A    public Deck (boolean debug, boolean populateDeck
+SIZE_OF_SPACE_CARDS_DECK, false);%0A    %7D%0A%0A    public Deck (int deckSize, boolean debug
 )%0A  
@@ -267,28 +267,24 @@
 nteger%3E(
-SIZE_OF_DECK
+deckSize
 );%0A     
@@ -316,36 +316,49 @@
    i
-f (populateDeck)
+nitialise();
 %0A    
+%7D%0A%0A
     
-   
+public final void
  pop
@@ -375,32 +375,79 @@
 ards
+ 
 ()
-;
 %0A    
+%7B%0A
     
-else
+    for (int i = 0; i %3C _theDeck.capacity(); i++)
 %0A       
     
@@ -442,34 +442,60 @@
 %0A       
+ %7B%0A
      
-initialise();
+       _theDeck.set(i, i);%0A        %7D
 %0A    %7D%0A%0A
@@ -505,20 +505,23 @@
  public 
-void
+boolean
  dealInt
@@ -537,32 +537,117 @@
 ecipient)%0A    %7B%0A
+        if (_theDeck.size() != recipient._theDeck.size())%0A            return false;%0A%0A
         for (int
@@ -654,36 +654,43 @@
  i = 0; i %3C 
-SIZE_OF_DECK
+_theDeck.capacity()
 ; i++)%0A     
@@ -729,28 +729,35 @@
 eck.set(
-SIZE_OF_DECK
+_theDeck.capacity()
  -1 -i, 
@@ -781,32 +781,54 @@
 t(i));%0A        %7D
+%0A%0A        return true;
 %0A    %7D%0A%0A    publ
@@ -911,36 +911,39 @@
  i = 0; i %3C 
-SIZE_OF_DECK
+_theDeck.size()
 ; i++)%0A     
@@ -1081,151 +1081,27 @@
 i %3C 
-SIZE_OF_DECK; i++)%0A            _theDeck.add(i, -1);%0A    %7D%0A%0A    private void populateWithCards ()%0A    %7B%0A        for (int i = 0; i %3C SIZE_OF_DECK
+_theDeck.capacity()
 ; i+
@@ -1128,20 +1128,18 @@
 eck.add(
-i, i
+-1
 );%0A    %7D

Update Deck.java