private void validateState(Operation start) { if (!start.hasBody()) { throw new IllegalArgumentException("attempt to initialize service with an empty state"); } BankAccountServiceState state = start.getBody(BankAccountServiceState.class); if (state.balance < 0) { throw new IllegalArgumentException("balance cannot be negative"); } }