### Question:
Util { public static ModelNode getOperation(final String operationName, final PathAddress address, final ModelNode params) { ModelNode op = createEmptyOperation(operationName, address); Set<String> keys = params.keys(); keys.remove(OP); keys.remove(OP_ADDR); for (String key : keys) { op.get(key).set(params.get(key)); } return op; } 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 testGetOperationForPathAddress() { String operationName = "fake"; PathAddress address = PathAddress.pathAddress("subsystem", "test"); ModelNode params = new ModelNode(); params.get("param1").set("value1"); params.get("param2").set("value2"); ModelNode operation = Util.getOperation(operationName, address, params); assertThat(operation.hasDefined(OP), is(true)); assertThat(operation.get(OP).asString(), is(operationName)); assertThat(operation.hasDefined(OP_ADDR), is(true)); assertThat(operation.get(OP_ADDR), is(address.toModelNode())); assertThat(operation.hasDefined("param1"), is(true)); assertThat(operation.get("param1").asString(), is("value1")); assertThat(operation.hasDefined("param2"), is(true)); assertThat(operation.get("param2").asString(), is("value2")); }
@Test public void testGetOperation() { String operationName = "fake"; ModelNode address = new ModelNode().add("subsystem", "test"); ModelNode params = new ModelNode(); params.get("param1").set("value1"); params.get("param2").set("value2"); ModelNode operation = Util.getOperation(operationName, address, params); assertThat(operation.hasDefined(OP), is(true)); assertThat(operation.get(OP).asString(), is(operationName)); assertThat(operation.hasDefined(OP_ADDR), is(true)); assertThat(operation.get(OP_ADDR), is(address)); assertThat(operation.hasDefined("param1"), is(true)); assertThat(operation.get("param1").asString(), is("value1")); assertThat(operation.hasDefined("param2"), is(true)); assertThat(operation.get("param2").asString(), is("value2")); }