@Test
public void testPerformanceMonitoredMethod() throws Exception {

  TestLoggers ls = TestLoggers.sys();
  // aspectj logs errors on MaxosX
  LogCollection<List<TestLogRecord>> collection = ls.collect("org.aspectj.weaver.bcel",
          org.spf4j.log.Level.ERROR, true, Collectors.toList());
  Registry.export(this);
  LogAssert expect = ls.expect("org.spf4j.perf.aspects.PerformanceMonitorAspect", Level.WARN,
          LogMatchers.hasFormat("Execution time  {} ms for {} exceeds warning threshold of {} ms, arguments {}"));
  for (int i = 0; i < 10; i++) {
    somethingTomeasure(i, "Test");
  }
  expect.assertObservation();
  List<TestLogRecord> errors = collection.get();
  if (!errors.isEmpty()) {
    LOG.info("aspectj misbehaves:", errors);
  }
}