public String decryptFilename(final BaseEncoding encoding, final String ciphertextName, final byte[] associatedData) throws AuthenticationFailedException {
        final CacheKey key = new CacheKey(encoding, ciphertextName, associatedData);
        if(decryptCache.contains(key)) {
            return decryptCache.get(key);
        }
        final String cleartextName = impl.decryptFilename(encoding, ciphertextName, associatedData);
        decryptCache.put(key, cleartextName);
        encryptCache.put(new CacheKey(encoding, cleartextName, associatedData), ciphertextName);
        return cleartextName;
    }
@Test
    public void TestDecryptFilename() {
        final FileNameCryptor mock = mock(FileNameCryptor.class);
        final CryptorCache cryptor = new CryptorCache(mock);
        when(mock.decryptFilename(any(), any(), any())).thenReturn(RandomStringUtils.randomAscii(10));
        final String decrypted1 = cryptor.decryptFilename(CryptorCache.BASE32, "first", "id1".getBytes());
        verify(mock, times(1)).decryptFilename(any(), any(), any());
        assertEquals(decrypted1, cryptor.decryptFilename(CryptorCache.BASE32, "first", "id1".getBytes()));
        verify(mock, times(1)).decryptFilename(any(), any(), any());
        // ensure using reverse cache from encryption
        assertEquals("first", cryptor.encryptFilename(CryptorCache.BASE32, decrypted1, "id1".getBytes()));
        verify(mock, times(1)).decryptFilename(any(), any(), any());
        verifyNoMoreInteractions(mock);
        // cache miss on encoding
        cryptor.decryptFilename(BaseEncoding.base64Url(), "first", "id1".getBytes());
        verify(mock, times(2)).decryptFilename(any(), any(), any());
        // cache miss on cleartext
        cryptor.decryptFilename(CryptorCache.BASE32, "second", "id1".getBytes());
        verify(mock, times(3)).decryptFilename(any(), any(), any());
        // cache miss on byte[]
        cryptor.decryptFilename(CryptorCache.BASE32, "first", "id2".getBytes());
        verify(mock, times(4)).decryptFilename(any(), any(), any());
    }