### Question:
FileBlockRecorder implements BlockRecorder, AutoCloseable { public void writeBlock(Block block) { try { writer.write(formatter.format(new Date())); writer.write(","); writer.write(String.valueOf(block.getNumber())); writer.write(","); writer.write(Hex.toHexString(block.getEncoded())); writer.newLine(); writer.flush(); } catch (IOException ex) { logger.error("Exception writing block: ", ex); } } FileBlockRecorder(String filename); void writeBlock(Block block); @Override void close();  }### Answer:
@Test public void writeBlock() throws Exception { FileBlockRecorder recorder = new FileBlockRecorder("testrecorder.txt"); recorder.writeBlock(new BlockGenerator().getGenesisBlock()); File file = new File("testrecorder.txt"); Assert.assertTrue(file.exists()); recorder.close(); Assert.assertTrue(file.delete()); }