public boolean isLoggable(LogRecord record) {
        String msg = record.getMessage();
        if (msg != null && recent.contains(msg)) {
            return false;  // duplicate
        } else {
            recent.addLast(msg);
            if (recent.size() > maxMessages) {
                recent.removeFirst();
            }
            return true;   // new message
        }
    }
@Test
    void basic() {
        RecentLogFilter rlf = new RecentLogFilter();
        List<LogRecord> logRecords = new ArrayList<>();
        for (int i = 0; i < RecentLogFilter.maxMessages + 1; i++) {
            logRecords.add(new LogRecord(Level.INFO, "" + i));
        }

        assertTrue(rlf.isLoggable(logRecords.get(0)));
        assertFalse(rlf.isLoggable(logRecords.get(0)));

        for (int i = 1; i < RecentLogFilter.maxMessages + 1; i++) {
            assertTrue(rlf.isLoggable(logRecords.get(i)));
        }

        // Should have filled up maxMessages slots with records 1-maxMessages
        // and pushed the first one out, so the below should return true
        assertTrue(rlf.isLoggable(logRecords.get(0)));
    }