@Test void testGetErrorCodedThrowable() { Throwable throwable = mock(CodedRuntimeException.class); assertEquals(of(throwable), getErrorCodedCause(throwable)); }
static Optional<Throwable> getErrorCodedCause(Throwable throwable) { for (Throwable cause = throwable; cause != null; cause = cause.getCause()) { if (cause instanceof ErrorCoded) { return Optional.of(cause); } } return Optional.empty(); }
ExceptionUtils { static Optional<Throwable> getErrorCodedCause(Throwable throwable) { for (Throwable cause = throwable; cause != null; cause = cause.getCause()) { if (cause instanceof ErrorCoded) { return Optional.of(cause); } } return Optional.empty(); } }
ExceptionUtils { static Optional<Throwable> getErrorCodedCause(Throwable throwable) { for (Throwable cause = throwable; cause != null; cause = cause.getCause()) { if (cause instanceof ErrorCoded) { return Optional.of(cause); } } return Optional.empty(); } private  ExceptionUtils(); }
ExceptionUtils { static Optional<Throwable> getErrorCodedCause(Throwable throwable) { for (Throwable cause = throwable; cause != null; cause = cause.getCause()) { if (cause instanceof ErrorCoded) { return Optional.of(cause); } } return Optional.empty(); } private  ExceptionUtils();  }
ExceptionUtils { static Optional<Throwable> getErrorCodedCause(Throwable throwable) { for (Throwable cause = throwable; cause != null; cause = cause.getCause()) { if (cause instanceof ErrorCoded) { return Optional.of(cause); } } return Optional.empty(); } private  ExceptionUtils();   }