private static Class<?> fail(final Class<?> type, final String typeParamName) {
        throw new IllegalStateException(
                "cannot determine the type of the type parameter '" + typeParamName + "': " + type);
    }
Most of the code references the pipeline design of
<a href="https://github.com/netty/netty">Netty</a>.
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/util/pipeline/TypeParameterMatcher.java