<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">//HandTest.java testing the Hand Class.

public class HandTest {
  public static void main(String[] args) {
    Deck deck = new Deck();
    Card card1;
    Hand hand = new Hand();
       
    deck.shuffle();
    System.out.println("\nShuffled deck\n" + deck);
    
    for (int i = 0; i &lt; 5; i++){
      card1 = deck.dealCard();
      hand.addCard(card1);
    }
    System.out.println("\nhand\n" + hand);
    
    hand.sortByValue();
    System.out.println("\nhand sorted by value\n" + hand);
    
    hand.removeCard(1);
    System.out.println("\nremove second card from hand\n" + hand);
    
    card1 = deck.dealCard();
    hand.addCard(card1);
    System.out.println("\nadd card to hand\n" + hand);
    
    hand.sortByValue();
    System.out.println("\nhand sorted by value\n" + hand);
    
    hand.sortBySuit();
    System.out.println("\nhand sorted by suit\n" + hand);
    
    hand.clear();
    System.out.println("\ncleared hand\n" + hand);

  }
}</pre></body></html>