### Question:
AbstractSegmentRecovery implements SegmentRecovery { @Override public void recoverAll() { for (Table table : com.fr.swift.db.impl.SwiftDatabase.getInstance().getAllTables()) { recover(table.getSourceKey()); } }  @Override void recover(SourceKey tableKey); @Override void recoverAll();  }### Answer:
@Test public void recoverAll() throws Exception { mockStatic(SwiftDatabase.class); when(SwiftDatabase.getInstance()).thenReturn(mock(Database.class)); List<Table> tables = Arrays.asList(mock(Table.class), mock(Table.class)); List<SourceKey> tableKeys = Arrays.asList(new SourceKey("t1"), new SourceKey("t2")); when(SwiftDatabase.getInstance().getAllTables()).thenReturn(tables); when(tables.get(0).getSourceKey()).thenReturn(tableKeys.get(0)); when(tables.get(1).getSourceKey()).thenReturn(tableKeys.get(1)); SegRecovery recovery = spy(new SegRecovery()); doNothing().when(recovery).recover(ArgumentMatchers.<SourceKey>any()); recovery.recoverAll(); verify(recovery).recover(tableKeys.get(0)); verify(recovery).recover(tableKeys.get(1)); }