### Question:
FullLattice { public Optional<LatticeMD> addIfMinimalAndSupported(MD md) { MDSite lhs = md.getLhs(); if (notSupported.containsMdOrGeneralization(lhs)) { return Optional.empty(); } return lattice.addIfMinimal(md); }  Optional<LatticeMD> addIfMinimalAndSupported(MD md); Collection<LatticeMD> findViolated(SimilaritySet similaritySet); int getDepth(); Collection<LatticeMD> getLevel(int level); void markNotSupported(MDSite lhs); int size();  }### Answer:
@Test public void testAddNotSupported() { FullLattice fullLattice = new FullLattice(lattice, notSupported); int columnPairs = 4; MDSite lhs = new MDSiteImpl(columnPairs).set(0, 0.5); when(Boolean.valueOf(notSupported.containsMdOrGeneralization(lhs))).thenReturn(Boolean.TRUE); MD md = new MDImpl(lhs, new MDElementImpl(1, 0.7)); Optional<LatticeMD> latticeMD = fullLattice.addIfMinimalAndSupported(md); assertThat(latticeMD).isEmpty(); verify(lattice, never()).addIfMinimal(md); }
@Test public void testAddSupported() { FullLattice fullLattice = new FullLattice(lattice, notSupported); int columnPairs = 4; MDSite lhs = new MDSiteImpl(columnPairs).set(0, 0.5); when(Boolean.valueOf(notSupported.containsMdOrGeneralization(lhs))).thenReturn(Boolean.FALSE); MD md = new MDImpl(lhs, new MDElementImpl(1, 0.7)); LatticeMD latticeMD = Mockito.mock(LatticeMD.class); when(lattice.addIfMinimal(md)).thenReturn(Optional.of(latticeMD)); assertThat(fullLattice.addIfMinimalAndSupported(md)).hasValue(latticeMD); verify(lattice).addIfMinimal(md); }