@Override
  public Stream<Pair<String, CompactionOperation>> getPendingCompactionOperations() {
    return execute(preferredView::getPendingCompactionOperations, () -> getSecondaryView().getPendingCompactionOperations());
  }
@Test
  public void testGetPendingCompactionOperations() {
    Stream<Pair<String, CompactionOperation>> actual;
    Stream<Pair<String, CompactionOperation>> expected = Collections.singleton(
            (Pair<String, CompactionOperation>) new ImmutablePair<>("test", new CompactionOperation()))
        .stream();

    when(primary.getPendingCompactionOperations()).thenReturn(expected);
    actual = fsView.getPendingCompactionOperations();
    assertEquals(expected, actual);
    verify(secondaryViewSupplier, never()).get();

    resetMocks();
    when(secondaryViewSupplier.get()).thenReturn(secondary);
    when(primary.getPendingCompactionOperations()).thenThrow(new RuntimeException());
    when(secondary.getPendingCompactionOperations()).thenReturn(expected);
    actual = fsView.getPendingCompactionOperations();
    assertEquals(expected, actual);

    resetMocks();
    when(secondary.getPendingCompactionOperations()).thenReturn(expected);
    actual = fsView.getPendingCompactionOperations();
    assertEquals(expected, actual);

    resetMocks();
    when(secondary.getPendingCompactionOperations()).thenThrow(new RuntimeException());
    assertThrows(RuntimeException.class, () -> {
      fsView.getPendingCompactionOperations();
    });
  }