private String filterName(String name, Handler handler) {
        if (name == null) {
            return generateName(handler);
        }

        if (context0(name) == null) {
            return name;
        }

        throw new IllegalArgumentException("Duplicate handler name: " + name);
    }
Most of the code references the pipeline design of
<a href="https://github.com/netty/netty">Netty</a>.

@author jiachun.fjc
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/util/pipeline/DefaultPipeline.java