From the prep: Learn MapReduce with Playing Cards a Mapper emits key-value pairs for only the numeric cards in a deck (the key being the suit and the value being the numeric value).
To be clear, numericValue() for ACE, KING, QUEEN, and JACK will return Optional.empty() and should be omitted.
class Deck implements Iterable<Card>
class Card
public Suit suit();
public Rank rank();
enum Suit
SPADES, HEARTS, DIAMONDS, CLUBS
enum Rank
ACE, KING, QUEEN, JACK,
TEN(10), NINE(9), EIGHT(8), SEVEN(7), SIX(6), FIVE(5), FOUR(4), THREE(3), TWO(2);
int numericValue();
boolean isNumericValuePresent();
public class CardMapper implements Mapper<Deck, Suit, Integer> {
@Override
public List<Map.Entry<Suit, Integer>> map(Deck deck) {
}
}