### Question:
AbstractFileCache { public synchronized void putFile(K key, File file, boolean move) throws CacheException { File cacheFile = this.getCacheFile(key); cacheFile.delete(); if (move) { try { FileUtils.moveFile(file, cacheFile); } catch (IOException e) { throw new CacheException(Messages.getString("AbstractFileCache.Exception.MoveFailed"), e); } } else { try { FileUtils.copyFile(file, cacheFile); } catch (IOException e) { throw new CacheException(Messages.getString("AbstractFileCache.Exception.MoveFailed"), e); } } } protected  AbstractFileCache(File cacheDirectory, String prefix, String suffix, final int maxAgeInSeconds); synchronized void clear(); synchronized boolean containsKey(K key); synchronized byte[] get(K key); synchronized InputStream getAsInputStream(K key); File getCacheDirectory(); File getCacheFile(K key); synchronized void purge(); synchronized void put(K key, byte[] value); synchronized void putFile(K key, File file, boolean move); synchronized void remove(K key);  }### Answer:
@Test public void testPutFile() throws CacheException, IOException { byte[] testBytes = "test".getBytes(StandardCharsets.US_ASCII); Path tempFile = null; try { tempFile = Files.createTempFile("AbstractFileCacheTest-testPutFileMove", ""); try (OutputStream outputStream = Files.newOutputStream(tempFile)) { outputStream.write(testBytes); } underTest.putFile("test", tempFile.toFile(), false); byte[] resultBytes = underTest.get("test"); assertTrue(Files.exists(tempFile)); assertArrayEquals(testBytes, resultBytes); } finally { if (tempFile != null) { Files.deleteIfExists(tempFile); } } }