@Override
  public Stream<FileSlice> getLatestFileSliceInRange(List<String> commitsToReturn) {
    return execute(commitsToReturn, preferredView::getLatestFileSliceInRange, (commits) -> getSecondaryView().getLatestFileSliceInRange(commits));
  }
@Test
  public void testGetLatestFileSliceInRange() {
    Stream<FileSlice> actual;
    Stream<FileSlice> expected = testFileSliceStream;
    List<String> commitsToReturn = Collections.singletonList("/table2");

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

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

    resetMocks();
    when(secondary.getLatestFileSliceInRange(commitsToReturn)).thenReturn(testFileSliceStream);
    actual = fsView.getLatestFileSliceInRange(commitsToReturn);
    assertEquals(expected, actual);

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