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

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

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

    resetMocks();
    when(secondary.getLatestBaseFilesInRange(commitsToReturn)).thenReturn(testBaseFileStream);
    actual = fsView.getLatestBaseFilesInRange(commitsToReturn);
    assertEquals(expected, actual);

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