@Test
public void testPutWithTtlCollection() throws Exception {

  // arrange
  S3AFileStatus fileStatus = mock(S3AFileStatus.class);
  when(fileStatus.getPath()).thenReturn(new Path("/"));
  Collection<PathMetadata> pmCollection = new ArrayList<>();
  for (int i = 0; i < 10; i++) {
    pmCollection.add(new PathMetadata(fileStatus));
  }
  MetadataStore ms = spy(MetadataStore.class);
  ITtlTimeProvider timeProvider =
      mock(ITtlTimeProvider.class);
  when(timeProvider.getNow()).thenReturn(100L);
  // act
  S3Guard.putWithTtl(ms, pmCollection, timeProvider, null);
  // assert
  pmCollection.forEach(
      pm -> assertEquals(100L, pm.getLastUpdated())
  );
  verify(timeProvider, times(1)).getNow();
  verify(ms, times(1)).put(pmCollection, null);
}