DefaultRuntimeErrorCallback { protected static boolean isServerOfflineException(final Throwable throwable) { Throwable cause = throwable.getCause(); String message = throwable.getMessage(); List<String> messages = Arrays.asList(SCRIPT_ERROR_MSG, PARSING_JSON_MSG, PARSING_JSON_SYNTAX_MSG); return cause == null && message != null && messages.stream().anyMatch(message::equals); }  void error(final Throwable throwable); void unlock(); static final String PARSING_JSON_SYNTAX_MSG; static final String PARSING_JSON_MSG; static final String SCRIPT_ERROR_MSG; }
@Test public void testIsServerOfflineException() { assertTrue(isServerOfflineException(new Exception(PARSING_JSON_SYNTAX_MSG))); assertTrue(isServerOfflineException(new Exception(PARSING_JSON_MSG))); assertTrue(isServerOfflineException(new Exception(SCRIPT_ERROR_MSG))); assertFalse(isServerOfflineException(new Exception())); assertFalse(isServerOfflineException(new Exception("any message"))); }