### Question:
CellPool { Candy[] assignRandomCandytypes() throws IOException, ParseException { var jp = new JsonParser(); jp.parse(); var randomCode = new Candy[jp.candies.size() - 2]; var i = 0; for (var e = jp.candies.keys(); e.hasMoreElements(); ) { var s = e.nextElement(); if (!s.equals(FRUIT) && !s.equals(CANDY)) { randomCode[i] = jp.candies.get(s); i++; } } return randomCode; } CellPool(int num);  static final String FRUIT; static final String CANDY; }### Answer:
@Test void assignRandomCandyTypesTest() { var cp = new CellPool(10); var ht = new Hashtable<String, Boolean>(); var parentTypes = 0; for (var i = 0; i < cp.randomCode.length; i++) { ht.putIfAbsent(cp.randomCode[i].name, true); if (cp.randomCode[i].name.equals("fruit") || cp.randomCode[i].name.equals("candy")) { parentTypes++; } } assertTrue(ht.size() == 5 && parentTypes == 0); }