test_class.file: proxy/src/test/java/com/wavefront/common/MessageDedupingLoggerTest.java
test_class.identifier: MessageDedupingLoggerTest
test_case.body: @Test
    public void testLogger() {
      Logger mockLogger = EasyMock.createMock(Logger.class);
      reset(mockLogger);
      expect(mockLogger.getName()).andReturn("loggerName").anyTimes();
      replay(mockLogger);
      Logger log = new MessageDedupingLogger(mockLogger, 1000, 0.1);
      reset(mockLogger);
      expect(mockLogger.getName()).andReturn("loggerName").anyTimes();
      Capture<LogRecord> logs = Capture.newInstance(CaptureType.ALL);
      mockLogger.log(capture(logs));
      expectLastCall().times(4);
      replay(mockLogger);
      log.severe("msg1");
      log.severe("msg1");
      log.warning("msg1");
      log.info("msg1");
      log.config("msg1");
      log.fine("msg1");
      log.finer("msg1");
      log.finest("msg1");
      log.warning("msg2");
      log.info("msg3");
      log.info("msg3");
      log.severe("msg4");
      log.info("msg3");
      log.info("msg3");
      log.severe("msg4");
      verify(mockLogger);
      assertEquals(4, logs.getValues().size());
      assertEquals("msg1", logs.getValues().get(0).getMessage());
      assertEquals(Level.SEVERE, logs.getValues().get(0).getLevel());
      assertEquals("msg2", logs.getValues().get(1).getMessage());
      assertEquals(Level.WARNING, logs.getValues().get(1).getLevel());
      assertEquals("msg3", logs.getValues().get(2).getMessage());
      assertEquals(Level.INFO, logs.getValues().get(2).getLevel());
      assertEquals("msg4", logs.getValues().get(3).getMessage());
      assertEquals(Level.SEVERE, logs.getValues().get(3).getLevel());
    }
test_case.class_method_signature: MessageDedupingLoggerTest.testLogger()
test_case.full_signature: @Test public void testLogger()
test_case.identifier: testLogger
test_case.invocations: createMock reset anyTimes andReturn expect getName replay reset anyTimes andReturn expect getName newInstance log capture times expectLastCall replay severe severe warning info config fine finer finest warning info info severe info info severe verify assertEquals size getValues assertEquals getMessage get getValues assertEquals getLevel get getValues assertEquals getMessage get getValues assertEquals getLevel get getValues assertEquals getMessage get getValues assertEquals getLevel get getValues assertEquals getMessage get getValues assertEquals getLevel get getValues
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLogger()
focal_class.declarator: rateLimiterCache
focal_class.modifier: private final
focal_class.original_string: private final LoadingCache<String, RateLimiter> rateLimiterCache;
focal_class.type: LoadingCache<String, RateLimiter>
focal_class.var_name: rateLimiterCache
focal_class.file: proxy/src/main/java/com/wavefront/common/MessageDedupingLogger.java
focal_class.identifier: MessageDedupingLogger
focal_class.class_method_signature: MessageDedupingLogger.MessageDedupingLogger(Logger delegate,
                                 long maximumSize,
                                 double rateLimit)
focal_class.full_signature: public  MessageDedupingLogger(Logger delegate,
                                 long maximumSize,
                                 double rateLimit)
focal_class.identifier: MessageDedupingLogger
focal_class.modifiers: public
focal_class.parameters: (Logger delegate,
                                 long maximumSize,
                                 double rateLimit)
focal_class.signature:  MessageDedupingLogger(Logger delegate,
                                 long maximumSize,
                                 double rateLimit)
focal_class.class_method_signature: MessageDedupingLogger.log(Level level, String message)
focal_class.full_signature: @Override public void log(Level level, String message)
focal_class.identifier: log
focal_class.modifiers: @Override public
focal_class.parameters: (Level level, String message)
focal_class.return: void
focal_class.signature: void log(Level level, String message)
focal_class.superclass: extends DelegatingLogger
focal_method.body: @Override
    public void log(Level level, String message) {
      if (Objects.requireNonNull(rateLimiterCache.get(message)).tryAcquire()) {
        log(new LogRecord(level, message));
      }
    }
focal_method.class_method_signature: MessageDedupingLogger.log(Level level, String message)
focal_method.full_signature: @Override public void log(Level level, String message)
focal_method.identifier: log
focal_method.invocations: tryAcquire requireNonNull get log
focal_method.modifiers: @Override public
focal_method.parameters: (Level level, String message)
focal_method.return: void
focal_method.signature: void log(Level level, String message)