class ListOfGenericMapsOutput<K, V> extends CommandOutput<K, V, List<Map<K, Object>>> {

    private final GenericMapOutput<K, V> nested;

    private int mapCount = -1;

    private final List<Integer> counts = new ArrayList<>();

    public ListOfGenericMapsOutput(RedisCodec<K, V> codec) {
        super(codec, new ArrayList<>());
        nested = new GenericMapOutput<>(codec);
    }

    @Override
    public void set(ByteBuffer bytes) {
        nested.set(bytes);
    }

    @Override
    public void complete(int depth) {<FILL_FUNCTION_BODY>}

    @Override
    public void multi(int count) {

        nested.multi(count);

        if (mapCount == -1) {
            mapCount = count;
        } else {
            // div 2 because of key value pair counts twice
            counts.add(count / 2);
        }
    }

    @Override
    public void set(long integer) {
        nested.set(integer);
    }

    @Override
    public void set(double number) {
        nested.set(number);
    }
}

        if (counts.size() > 0) {
            int expectedSize = counts.get(0);

            if (nested.get().size() == expectedSize) {
                counts.remove(0);
                output.add(new LinkedHashMap<>(nested.get()));
                nested.get().clear();
            }
        }
    
<methods>public void <init>(RedisCodec<K,V>, List<Map<K,java.lang.Object>>) ,public void complete(int) ,public List<Map<K,java.lang.Object>> get() ,public java.lang.String getError() ,public boolean hasError() ,public void multi(int) ,public void multiArray(int) ,public void multiMap(int) ,public void multiPush(int) ,public void multiSet(int) ,public void set(java.nio.ByteBuffer) ,public void set(long) ,public void set(double) ,public void set(boolean) ,public void setBigNumber(java.nio.ByteBuffer) ,public void setError(java.nio.ByteBuffer) ,public void setError(java.lang.String) ,public void setSingle(java.nio.ByteBuffer) ,public java.lang.String toString() <variables>protected final non-sealed RedisCodec<K,V> codec,protected java.lang.String error,protected List<Map<K,java.lang.Object>> output