public static LocalRetryableExecution executeLocallyWithRetry(NodeEngine nodeEngine, Operation operation) {
        if (operation.getOperationResponseHandler() != null) {
            throw new IllegalArgumentException("Operation must not have a response handler set");
        }
        if (!operation.returnsResponse()) {
            throw new IllegalArgumentException("Operation must return a response");
        }
        if (operation.validatesTarget()) {
            throw new IllegalArgumentException("Operation must not validate the target");
        }
        final LocalRetryableExecution execution = new LocalRetryableExecution(nodeEngine, operation);
        execution.run();
        return execution;
    }
@Test(expected = IllegalArgumentException.class)
    public void executeLocallyWithRetryFailsWhenOperationValidatesTarget() {
        final Operation op = new Operation() {
            @Override
            public boolean validatesTarget() {
                return true;
            }
        };
        executeLocallyWithRetry(null, op);
    }