@Override
    public KVState set(final int index, final KVState element) {
        if (element == null) {
            throw new NullPointerException("element");
        }
        return super.set(index, element);
    }
You must first check to make sure that {@link #isSingletonList()}
returns true.
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/storage/KVStateOutputList.java