### Question:
ApimlLogger { public Message log(String key, Object... parameters) { ObjectUtil.requireNotNull(key, "key can't be null"); ObjectUtil.requireNotNull(parameters, "parameters can't be null"); if (messageService != null) { Message message = messageService.createMessage(key, parameters); log(message); return message; } return null; } ApimlLogger(Class<?> clazz, MessageService messageService); static ApimlLogger of(Class<?> clazz,
                                 MessageService messageService); static ApimlLogger empty(); Message log(String key, Object... parameters); void log(Message message); @SuppressWarnings("squid:S2629") void log(MessageType messageType, String text, Object... arguments);  }### Answer:
@Test public void testLogLevel() { ApimlLogger apimlLogger = new ApimlLogger(ApimlLoggerTest.class, null); Logger logger = mock(Logger.class); ReflectionTestUtils.setField(apimlLogger, "logger", logger); Marker marker = (Marker) ReflectionTestUtils.getField(apimlLogger, "marker"); apimlLogger.log(MessageType.TRACE, "traceLog", new Object[] {"param1"}); verify(logger, times(1)).trace(marker, "traceLog", new Object[] {"param1"}); apimlLogger.log(MessageType.DEBUG, "debugLog", new Object[] {"param2"}); verify(logger, times(1)).debug(marker, "debugLog", new Object[] {"param2"}); apimlLogger.log(MessageType.INFO, "infoLog", new Object[] {"param3"}); verify(logger, times(1)).info(marker, "infoLog", new Object[] {"param3"}); apimlLogger.log(MessageType.WARNING, "warningLog", new Object[] {"param4"}); verify(logger, times(1)).warn(marker, "warningLog", new Object[] {"param4"}); apimlLogger.log(MessageType.ERROR, "errorLog", new Object[] {"param5"}); verify(logger, times(1)).error(marker, "errorLog", new Object[] {"param5"}); verify(logger, times(1)).trace((Marker) any(), anyString(), (Object[]) any()); verify(logger, times(1)).debug((Marker) any(), anyString(), (Object[]) any()); verify(logger, times(1)).info((Marker) any(), anyString(), (Object[]) any()); verify(logger, times(1)).warn((Marker) any(), anyString(), (Object[]) any()); verify(logger, times(1)).error((Marker) any(), anyString(), (Object[]) any()); }