<S extends CodeSection> List<CodeInterceptor<CodeSection, T>> getInterceptors(S forSection) {
            // Add in parent interceptors.
            List<CodeInterceptor<CodeSection, T>> result = new ArrayList<>();
            // Merge in local interceptors.
            for (CodeInterceptor<CodeSection, T> interceptor : interceptors) {
                // Add the interceptor only if it's the right type.
                if (interceptor.sectionType().isInstance(forSection)) {
                    // Only add if the filter passes.
                    if (interceptor.isIntercepted(forSection)) {
                        result.add(interceptor);
                    }
                }
            }

            return result;
        }
Gets a list of interceptors that match the given type and for which the
result of {@link CodeInterceptor#isIntercepted(CodeSection)} returns true
when given {@code forSection}.

@param forSection The section that is being intercepted.
@param <S> The type of section being intercepted.
@return Returns the list of matching interceptors.
smithy-utils/src/main/java/software/amazon/smithy/utils/AbstractCodeWriter.java