public static void warn(Logger logger, String msg, Throwable e) {
        if (logger == null) {
            return;
        }

        if (logger.isWarnEnabled()) {
            logger.warn(msg, e);
        }
    }
@Test
    void testWarn() {
        Logger logger = Mockito.mock(Logger.class);
        when(logger.isWarnEnabled()).thenReturn(true);
        LogHelper.warn(logger, "warn");
        verify(logger).warn("warn");
        Throwable t = new RuntimeException();
        LogHelper.warn(logger, t);
        verify(logger).warn(t);
        LogHelper.warn(logger, "warn", t);
        verify(logger).warn("warn", t);
    }