@Override
  public Option<HoodieInstant> getLastInstant() {
    return execute(preferredView::getLastInstant, () -> getSecondaryView().getLastInstant());
  }
@Test
  public void testGetLastInstant() {
    Option<HoodieInstant> actual;
    Option<HoodieInstant> expected = Option.of(new HoodieInstant(true, "", ""));

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

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

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

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