### Question:
DiagnosisHittingSet { public boolean covers(DiagnosisHittingSet other) { Preconditions.notNull(other); return other.getDiagnosisElements().stream().allMatch(this::contains); } DiagnosisHittingSet(List<DiagnosisElement> diagnosisElements); List<DiagnosisElement> getDiagnosisElements(); boolean covers(DiagnosisHittingSet other); boolean contains(DiagnosisElement otherElement); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void testCoversEqual() { final DiagnosisHittingSet a = new DiagnosisHittingSet(singletonList( new DiagnosisElement(1, new int[] {1}, new int[] {1}))); final DiagnosisHittingSet b = new DiagnosisHittingSet(singletonList( new DiagnosisElement(1, new int[] {1}, new int[] {1}))); assertTrue(a.covers(b)); assertTrue(b.covers(a)); }
@Test void testCoversEqualElement() { final DiagnosisHittingSet a = new DiagnosisHittingSet(asList( new DiagnosisElement(1, new int[] {1}, new int[] {1}), new DiagnosisElement(2, new int[] {2}, new int[] {2}))); final DiagnosisHittingSet b = new DiagnosisHittingSet(singletonList( new DiagnosisElement(1, new int[] {1}, new int[] {1}))); assertTrue(a.covers(b)); assertFalse(b.covers(a)); }
@Test void testDoesNotCover() { final DiagnosisHittingSet a = new DiagnosisHittingSet(asList( new DiagnosisElement(1, new int[] {1}, new int[] {1}), new DiagnosisElement(2, new int[] {0, 2}, new int[] {0, 1}))); final DiagnosisHittingSet b = new DiagnosisHittingSet(singletonList( new DiagnosisElement(2, new int[] {0, 2}, new int[] {0, 2}))); assertFalse(a.covers(b)); assertFalse(b.covers(a)); }