class TryConsumeCommand implements RemoteCommand<Boolean>, ComparableByContent<TryConsumeCommand> {

    public static final TryConsumeCommand TRY_CONSUME_ONE = new TryConsumeCommand(1);

    private long tokensToConsume;

    public static final SerializationHandle<TryConsumeCommand> SERIALIZATION_HANDLE = new SerializationHandle<TryConsumeCommand>() {
        @Override
        public <S> TryConsumeCommand deserialize(DeserializationAdapter<S> adapter, S input) throws IOException {
            int formatNumber = adapter.readInt(input);
            Versions.check(formatNumber, v_7_0_0, v_7_0_0);

            long tokensToConsume = adapter.readLong(input);
            return TryConsumeCommand.create(tokensToConsume);
        }

        @Override
        public <O> void serialize(SerializationAdapter<O> adapter, O output, TryConsumeCommand command, Version backwardCompatibilityVersion, Scope scope) throws IOException {
            adapter.writeInt(output, v_7_0_0.getNumber());

            adapter.writeLong(output, command.tokensToConsume);
        }

        @Override
        public int getTypeId() {
            return 29;
        }

        @Override
        public Class<TryConsumeCommand> getSerializedType() {
            return TryConsumeCommand.class;
        }

        @Override
        public TryConsumeCommand fromJsonCompatibleSnapshot(Map<String, Object> snapshot) throws IOException {
            int formatNumber = readIntValue(snapshot, "version");
            Versions.check(formatNumber, v_7_0_0, v_7_0_0);

            long tokensToConsume = readLongValue(snapshot, "tokensToConsume");
            return TryConsumeCommand.create(tokensToConsume);
        }

        @Override
        public Map<String, Object> toJsonCompatibleSnapshot(TryConsumeCommand command, Version backwardCompatibilityVersion, Scope scope) throws IOException {
            Map<String, Object> result = new HashMap<>();
            result.put("version", v_7_0_0.getNumber());
            result.put("tokensToConsume", command.tokensToConsume);
            return result;
        }

        @Override
        public String getTypeName() {
            return "TryConsumeCommand";
        }

    };

    private TryConsumeCommand(long tokensToConsume) {
        this.tokensToConsume = tokensToConsume;
    }

    @Override
    public RemoteCommand<?> toMergedCommand() {
        ConsumeAsMuchAsPossibleCommand merged = new ConsumeAsMuchAsPossibleCommand(1);
        merged.setMerged(true);
        return merged;
    }

    @Override
    public boolean canBeMerged(RemoteCommand<?> another) {
        return this == TRY_CONSUME_ONE && another == TRY_CONSUME_ONE;
    }

    @Override
    public void mergeInto(RemoteCommand<?> mergedCommand) {
        ConsumeAsMuchAsPossibleCommand mergedConsume = (ConsumeAsMuchAsPossibleCommand) mergedCommand;
        mergedConsume.setLimit(mergedConsume.getLimit() + 1);
    }

    public static TryConsumeCommand create(long tokensToConsume) {
        if (tokensToConsume == 1) {
            return TRY_CONSUME_ONE;
        } else {
            return new TryConsumeCommand(tokensToConsume);
        }
    }

    @Override
    public CommandResult<Boolean> execute(MutableBucketEntry mutableEntry, long currentTimeNanos) {<FILL_FUNCTION_BODY>}

    public long getTokensToConsume() {
        return tokensToConsume;
    }

    @Override
    public SerializationHandle getSerializationHandle() {
        return SERIALIZATION_HANDLE;
    }

    @Override
    public boolean equalsByContent(TryConsumeCommand other) {
        return tokensToConsume == other.tokensToConsume;
    }

    @Override
    public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) {
        return false;
    }

    @Override
    public long estimateTokensToConsume() {
        return tokensToConsume;
    }

    @Override
    public long getConsumedTokens(Boolean result) {
        return result ? tokensToConsume : 0;
    }

    @Override
    public Version getRequiredVersion() {
        return v_7_0_0;
    }

}

        if (!mutableEntry.exists()) {
            return CommandResult.bucketNotFound();
        }

        RemoteBucketState state = mutableEntry.get();
        state.refillAllBandwidth(currentTimeNanos);
        long availableToConsume = state.getAvailableTokens();
        if (tokensToConsume <= availableToConsume) {
            state.consume(tokensToConsume);
            mutableEntry.set(state);
            return CommandResult.TRUE;
        } else {
            return CommandResult.FALSE;
        }
    
<no_super_class>