### Question:
Log implements Closeable { public void clear() throws ChangelogException { exclusiveLock.lock(); try { if (isClosed) { return; } if (!openCursors.isEmpty()) { abortAllOpenCursors(); } final List<String> undeletableFiles = new ArrayList<>(); for (LogFile<K, V> logFile : logFiles.values()) { try { logFile.close(); logFile.delete(); } catch (ChangelogException e) { undeletableFiles.add(logFile.getFile().getPath()); } } if (!undeletableFiles.isEmpty()) { throw new ChangelogException(ERR_CHANGELOG_UNABLE_TO_DELETE_LOG_FILE.get( Utils.joinAsString(", ", undeletableFiles))); } logFiles.clear(); openHeadLogFile(); } catch (Exception e) { throw new ChangelogException(ERR_ERROR_CLEARING_DB.get(logPath.getPath(), stackTraceToSingleLineString(e))); } finally { exclusiveLock.unlock(); } } private  Log(final ReplicationEnvironment replicationEnv, final File logPath, final RecordParser<K, V> parser,
      final LogRotationParameters rotationParams); File getPath(); void append(final Record<K, V> record); void syncToFileSystem(); RepositionableCursor<K, V> getCursor(); RepositionableCursor<K, V> getCursor(final K key); RepositionableCursor<K, V> getCursor(final K key, final KeyMatchingStrategy matchingStrategy,
      final PositionStrategy positionStrategy); Record<K, V> getOldestRecord(); Record<K, V> getNewestRecord(); long getNumberOfRecords(); Record<K,V> purgeUpTo(final K purgeKey); void clear(); @Override void close();  }### Answer:
@Test public void testClear() throws Exception { try (Log<String, String> log = openLog(LogFileTest.RECORD_PARSER)) { log.clear(); try (DBCursor<Record<String, String>> cursor = log.getCursor()) { assertThatCursorIsExhausted(cursor); } } }