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

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