@Test
  public void testGetCheckpointIndexIgnoresStoresNotInStoresToBackupRestoreSet() {
    String store = "storeName1";
    String anotherStore = "storeName2";
    String oneMoreStore = "storeName3";
    SnapshotIndex mockStoreSnapshotIndex = mock(SnapshotIndex.class);
    Set<String> storesToBackupOrRestore = ImmutableSet.of(store, anotherStore);
    CheckpointV2 checkpoint = createCheckpointV2(BlobStoreStateBackendFactory.class.getName(),
        ImmutableMap.of(store, "1", anotherStore, "2", oneMoreStore, "3"));
    BlobStoreUtil mockBlobStoreUtil = mock(BlobStoreUtil.class);
    when(mockBlobStoreUtil.getSnapshotIndex(any(String.class), any(Metadata.class), anyBoolean()))
        .thenReturn(CompletableFuture.completedFuture(mockStoreSnapshotIndex));
    when(mockBlobStoreUtil.getStoreSnapshotIndexes(anyString(), anyString(), anyString(),
        any(Checkpoint.class), anySetOf(String.class), anyBoolean())).thenCallRealMethod();

    Map<String, Pair<String, SnapshotIndex>> snapshotIndexes =
        mockBlobStoreUtil.getStoreSnapshotIndexes("testJobName", "testJobId", "taskName",
            checkpoint, storesToBackupOrRestore, false);

    verify(mockBlobStoreUtil, times(storesToBackupOrRestore.size()))
        .getSnapshotIndex(anyString(), any(Metadata.class), anyBoolean());
  }
Tests related to {@link BlobStoreUtil#getStoreSnapshotIndexes}
samza-core/src/test/java/org/apache/samza/storage/blobstore/util/TestBlobStoreUtil.java