### Question:
Util { public static String getNameFromAddress(final ModelNode address) { PathElement pe = PathAddress.pathAddress(address).getLastElement(); return pe == null ? null : pe.getValue(); } 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 testGetNameFromAddress_ModelNode() { ModelNode address = new ModelNode(); assertThat(Util.getNameFromAddress(address), is(nullValue())); address = new ModelNode().get("subsystem"); assertThat(Util.getNameFromAddress(address), is(nullValue())); address = new ModelNode().add("subsystem", "test"); assertThat(Util.getNameFromAddress(address), is("test")); }
@Test public void testGetNameFromAddress_PathAddress() { System.out.println("getNameFromAddress"); PathAddress address = PathAddress.EMPTY_ADDRESS; assertThat(Util.getNameFromAddress(address), is(nullValue())); address = PathAddress.pathAddress(PathElement.pathElement("subsystem")); assertThat(Util.getNameFromAddress(address), is(PathElement.WILDCARD_VALUE)); address = PathAddress.pathAddress("subsystem", "test"); assertThat(Util.getNameFromAddress(address), is("test")); }