### Question:
LotteryNumbers { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } LotteryNumbers other = (LotteryNumbers) obj; if (numbers == null) { if (other.numbers != null) { return false; } } else if (!numbers.equals(other.numbers)) { return false; } return true; } private  LotteryNumbers(); private  LotteryNumbers(Set<Integer> givenNumbers); static LotteryNumbers createRandom(); static LotteryNumbers create(Set<Integer> givenNumbers); Set<Integer> getNumbers(); String getNumbersAsString(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final int MIN_NUMBER; static final int MAX_NUMBER; static final int NUM_NUMBERS; }### Answer:
@Test void testEquals() { LotteryNumbers numbers1 = LotteryNumbers.create( new HashSet<>(Arrays.asList(1, 2, 3, 4))); LotteryNumbers numbers2 = LotteryNumbers.create( new HashSet<>(Arrays.asList(1, 2, 3, 4))); assertEquals(numbers1, numbers2); LotteryNumbers numbers3 = LotteryNumbers.create( new HashSet<>(Arrays.asList(11, 12, 13, 14))); assertNotEquals(numbers1, numbers3); }
@Test public void testEquals() { LotteryNumbers numbers1 = LotteryNumbers.create( new HashSet<>(Arrays.asList(1, 2, 3, 4))); LotteryNumbers numbers2 = LotteryNumbers.create( new HashSet<>(Arrays.asList(1, 2, 3, 4))); assertTrue(numbers1.equals(numbers2)); LotteryNumbers numbers3 = LotteryNumbers.create( new HashSet<>(Arrays.asList(11, 12, 13, 14))); assertFalse(numbers1.equals(numbers3)); }