import java.util.ArrayList;
import java.util.List;

public class Hand {
    private List<Card> cards = new ArrayList<Card>();

    // Constructor
    public Hand(ArrayList<Card> cards) {
        this.cards = cards;
    }

    // Called when player wants to hit
    public void addCard(Card card) {
        cards.add(card);
    }

    // Returns an array of length 1 or 2 containing possible values of the hand
    public int[] getValues() {
        int val0 = 0; // Hand value assuming first ace is valued at 1
        int val1 = 0; // Hand value assuming first ace is valued at 11
        boolean hasAce = false;
        int[] cardValue;

        // If Ace
        if(cardValue.length == 2) {
            // If Ace already exists in hand, just add 1
            if(hasAce) {
                val0 += cardValue[0]; // 1
                val1 += cardValue[0]; // 1
            }
            else {
                val0 += cardValue[0]; // 1
                val1 += cardValue[1]; // 11
                hasAce = true;
            }
        }

        // Otherwise single-value cards (2-10, J, Q, K)
        else {
            val0 += cardValue[0];
            val1 += cardValue[0];
        }

        if(val0 == val1) {
            return new int[] { val0 };
        }
        else {
            return new int[] {val0, val1};
        }
    }

    // TODO
   public Hand split() {
        if(cards.size() != 2) {
            return null;
        }

        Hand[] newHands = new Hand[2];
        ArrayList<Card> cardForHand0 = new ArrayList<Card>();
        ArrayList<Card> cardForHand1 = new ArrayList<Card>();


        newHands[0] = new Hand();
   }
}

@@ -1336,20 +1336,8 @@
  %7D%0A%0A
-    // TODO%0A
    p
@@ -1353,19 +1353,74 @@
 d split(
-) %7B
+Shoe shoe) %7B%0A        // Can split only if hand has 2 cards
 %0A       
@@ -1531,39 +1531,31 @@
     
-ArrayList%3CCard%3E cardForHand0 = 
+newHands%5B0%5D = new Hand(
 new 
@@ -1571,16 +1571,17 @@
 %3CCard%3E()
+)
 ;%0A      
@@ -1586,39 +1586,31 @@
     
-ArrayList%3CCard%3E cardForHand1 = 
+newHands%5B1%5D = new Hand(
 new 
@@ -1630,12 +1630,12 @@
 d%3E()
+)
 ;%0A%0A
-%0A
     
@@ -1653,21 +1653,115 @@
 s%5B0%5D
+.addCard(shoe.removeTopCard());%0A      
  
-=
  new
- 
 Hand
-()
+s%5B1%5D.addCard(shoe.removeTopCard());%0A%0A        return newHands
 ;%0A  

Implement hand.split()