### Question:
DeckValidator { public boolean validate(Deck deck, ArrayList<Pack> packs) { boolean mwlValid = mMostWantedList == null || CheckMwl(deck); boolean cardPoolValid = CheckCardPool(deck, packs); return mwlValid && cardPoolValid; } DeckValidator(MostWantedList mwl); boolean validate(Deck deck, ArrayList<Pack> packs);  }### Answer:
@Test public void NoMWLNoRotation_OnlylegalCards_PassesValidation(){ MostWantedList mwl = new MostWantedList(); DeckValidator validator = new DeckValidator(mwl); Card idCard = new CardBuilder("").withCode("idCard").withSetCode(legalSetCode).Build(); Format format = new FormatBuilder().asCoreExperience().Build(); Deck deck = new Deck(idCard, format); Card legalCard = new CardBuilder("").withSetCode(legalSetCode).Build(); assertTrue(format.getPacks().contains(legalSetCode)); deck.updateCardCount(legalCard, 2); assertEquals(1, deck.getCards().size()); boolean valid = validator.validate(deck, packs); assertTrue(valid); }
@Test public void NoMWLNoRotation_IllegalCards_FailValidation(){ MostWantedList mwl = new MostWantedList(); DeckValidator validator = new DeckValidator(mwl); Card idCard = new CardBuilder("").withCode("idCard").Build(); Format format = new FormatBuilder().asCoreExperience().Build(); Deck deck = new Deck(idCard, format); String illegalSetCode = "illegal-notSC19"; Card illegalCard = new CardBuilder("").withSetCode(illegalSetCode).Build(); assertFalse(format.getPacks().contains(illegalSetCode)); deck.updateCardCount(illegalCard,2); assertEquals(1, deck.getCards().size()); boolean valid = validator.validate(deck, packs); assertFalse(valid); }