@Test
public void testRemoveUnusedValues() throws BinaryStoreException {

    expect(s3Client.getBucketLifecycleConfiguration(BUCKET)).andReturn(bucketLifecycleConfiguration);
    if (deleteUnusedNatively) {
        if (!getUnusedRule(bucketLifecycleConfiguration).filter(isEnabled()).isPresent()) {
            s3Client.setBucketLifecycleConfiguration(eq(BUCKET), S3BinaryStoreTest.customMatcher(description, blc ->
                    getUnusedRule(blc).filter(isEnabled()).isPresent()));
            EasyMock.expectLastCall();
        }
    } else {
        if (getUnusedRule(bucketLifecycleConfiguration).filter(isEnabled()).isPresent()) {
            s3Client.setBucketLifecycleConfiguration(eq(BUCKET), S3BinaryStoreTest.customMatcher(description, blc ->
                    getUnusedRule(blc).filter(isDisabled()).isPresent()));
            EasyMock.expectLastCall();
        }
        expect(s3Client.listObjects(isA(ListObjectsRequest.class))).andReturn(objectListing);
        expect(objectListing.getObjectSummaries()).andReturn(Collections.emptyList());
        expect(objectListing.isTruncated()).andReturn(false);
        expect(objectListing.isTruncated()).andReturn(false);
        expect(s3Client.listObjects(isA(ListObjectsRequest.class))).andReturn(objectListing);
        expect(objectListing.getObjectSummaries()).andReturn(Collections.emptyList());
        expect(objectListing.isTruncated()).andReturn(false);
        expect(objectListing.isTruncated()).andReturn(false);
    }
    replayAll();
    s3BinaryStore.removeValuesUnusedLongerThan(1, TimeUnit.HOURS);
    s3BinaryStore.removeValuesUnusedLongerThan(1, TimeUnit.HOURS);
    verifyAll();
}