### Question:
TimerNameCache { public TimerName getTimerName(Class<?> adviceClass) { if (adviceClass == null) { logger.error("getTimerName(): argument 'adviceClass' must be non-null"); return unknownTimerName; } Pointcut pointcut = adviceClass.getAnnotation(Pointcut.class); if (pointcut == null) { logger.warn("advice has no @Pointcut: {}", adviceClass.getName()); return unknownTimerName; } else if (pointcut.timerName().isEmpty()) { logger.warn("advice @Pointcut has no timerName() attribute: {}", adviceClass.getName()); return unknownTimerName; } else { return getName(pointcut.timerName()); } }  TimerName getTimerName(Class<?> adviceClass);  }### Answer:
@Test public void testNullClass() { TimerNameCache timerNameCache = new TimerNameCache(); TimerName timerName = timerNameCache.getTimerName((Class<?>) null); assertThat(((TimerNameImpl) timerName).name()).isEqualTo("unknown"); }
@Test public void testClassWithoutPointcutAnnotation() { TimerNameCache timerNameCache = new TimerNameCache(); TimerName timerName = timerNameCache.getTimerName(A.class); assertThat(((TimerNameImpl) timerName).name()).isEqualTo("unknown"); }
@Test public void testClassWithEmptyTimerName() { TimerNameCache timerNameCache = new TimerNameCache(); TimerName timerName = timerNameCache.getTimerName(B.class); assertThat(((TimerNameImpl) timerName).name()).isEqualTo("unknown"); }
@Test public void testNormal() { TimerNameCache timerNameCache = new TimerNameCache(); TimerName timerName = timerNameCache.getTimerName(C.class); assertThat(((TimerNameImpl) timerName).name()).isEqualTo("z"); }