private boolean wrappedCauseMatches(RetryPolicyContext context, Class<? extends Exception> exceptionClass) {
        if (context.exception().getCause() == null) {
            return false;
        }
        return context.exception().getCause().getClass().equals(exceptionClass);
    }
private boolean wrappedCauseMatches ( RetryPolicyContext context , Class < ? extends Exception > exceptionClass ) { if ( context . exception ( ) . getCause ( ) == null ) { return false ; } return context . exception ( ) . getCause ( ) . getClass ( ) . equals ( exceptionClass ) ; }
@param context        Context containing exception.
@param exceptionClass Expected exception class.
@return True if the cause of the exception in the context matches the provided class.