### Question:
Util { public static ModelNode validateOperation(ModelNode operation) { ModelNode responseNode = new ModelNode(); StringBuilder errors = new StringBuilder(); if (!operation.hasDefined(OP) || operation.get(OP).asString() == null || operation.get(OP).asString().isEmpty()) { errors.append(ControllerLogger.ROOT_LOGGER.noOperationDefined(operation)); } if (operation.hasDefined(OP_ADDR)) { try { if(operation.get(OP_ADDR).getType() == ModelType.STRING) { ModelNode address = PathAddress.parseCLIStyleAddress(operation.get(OP_ADDR).asString()).toModelNode(); operation.get(OP_ADDR).set(address); } else { operation.get(OP_ADDR).asList(); } } catch (IllegalArgumentException ex) { if (errors.length() > 0) { errors.append(System.lineSeparator()); } if(ex.getMessage() != null) { errors.append(ex.getMessage()); } else { errors.append(ControllerLogger.ROOT_LOGGER.attributeIsWrongType(OP_ADDR, ModelType.LIST, operation.get(OP_ADDR).getType()).getMessage()); } } } if (errors.length() > 0) { responseNode.get(OUTCOME).set(FAILED); responseNode.get(FAILURE_DESCRIPTION).set(errors.toString()); } return responseNode; } private  Util(); static String getNameFromAddress(final ModelNode address); static String getNameFromAddress(PathAddress address); static ModelNode createAddOperation(final PathAddress address); static ModelNode createAddOperation(); static ModelNode createRemoveOperation(final PathAddress address); static ModelNode createOperation(final String operationName, final PathAddress address); static ModelNode createOperation(final OperationDefinition operationDefinition, final PathAddress address); static ModelNode createEmptyOperation(String operationName, final PathAddress address); static ModelNode getEmptyOperation(String operationName, ModelNode address); static ModelNode getResourceRemoveOperation(final PathAddress address); static ModelNode getWriteAttributeOperation(ModelNode address, String attributeName, String value); static ModelNode getWriteAttributeOperation(final PathAddress address, String attributeName, int value); static ModelNode getWriteAttributeOperation(final PathAddress address, String attributeName, boolean value); static ModelNode getWriteAttributeOperation(final ModelNode address, String attributeName, ModelNode value); static ModelNode getWriteAttributeOperation(final PathAddress  address, String attributeName, String value); static ModelNode getWriteAttributeOperation(final PathAddress address, String attributeName, ModelNode value); static ModelNode getReadAttributeOperation(final PathAddress address, String attributeName); static ModelNode getReadResourceDescriptionOperation(final PathAddress address); static ModelNode getUndefineAttributeOperation(final PathAddress address, String attributeName); static boolean isExpression(String value); static ModelNode getOperation(final String operationName, final PathAddress address, final ModelNode params); static ModelNode getOperation(String operationName, ModelNode address, ModelNode params); static PathAddress getParentAddressByKey(PathAddress address, String parentKey); static ModelNode validateOperation(ModelNode operation);  }### Answer:
@Test public void testValidateOperation() { ModelNode operation = new ModelNode(); assertThat(Util.validateOperation(operation).hasDefined(OUTCOME), is(true)); assertThat(Util.validateOperation(operation).get(OUTCOME).asString(), is(FAILED)); operation.get(OP).set("fake"); assertThat(Util.validateOperation(operation).hasDefined(OUTCOME), is(false)); operation.get(OP_ADDR).set("a"); assertThat(Util.validateOperation(operation).hasDefined(OUTCOME), is(true)); assertThat(Util.validateOperation(operation).get(OUTCOME).asString(), is(FAILED)); operation.get(OP_ADDR).setEmptyList(); assertThat(Util.validateOperation(operation).hasDefined(OUTCOME), is(false)); }