@Test
public void testIsRetractedWithRetractedRetractionTwoLevels() {

  FactRecord fact = new FactRecord().setId(UUID.randomUUID()).setFlags(set(FactRecord.Flag.RetractedHint));
  FactDocument retraction1 = new FactDocument().setId(UUID.randomUUID());
  FactDocument retraction2 = new FactDocument().setId(UUID.randomUUID());
  FactDocument retraction3 = new FactDocument().setId(UUID.randomUUID());
  // fact ---> retraction1 ---> retraction2 ---> retraction3
  // retraction3 cancels out retraction2, thus, fact is retracted because retraction1 holds.
  when(factSearchManager.searchFacts(inReferenceTo(fact.getId()))).thenReturn(createSearchResult(retraction1));
  when(factSearchManager.searchFacts(inReferenceTo(retraction1.getId()))).thenReturn(createSearchResult(retraction2));
  when(factSearchManager.searchFacts(inReferenceTo(retraction2.getId()))).thenReturn(createSearchResult(retraction3));
  assertTrue(handler.isRetracted(fact));
}