### Question:
DataNodeEvent extends MapEvent { @Override public String getNewName() { return (dataNode != null) ? dataNode.getName() : null; } DataNodeEvent(Object src, DataNodeDescriptor nextNode);  DataNodeEvent(Object src, DataNodeDescriptor node, int id);  DataNodeEvent(Object src, DataNodeDescriptor node, String oldName); DataNodeDescriptor getDataNode(); void setDataNode(DataNodeDescriptor dataNode); @Override String getNewName();  }### Answer:
@Test public void testNewName() throws Exception { MapEvent event = new DataNodeEvent(new Object(), new DataNodeDescriptor("someName")); assertEquals("someName", event.getNewName()); }
@Test public void testNameChange() throws Exception { MapEvent event = new DataNodeEvent( new Object(), new DataNodeDescriptor("someName"), "someOldName"); assertEquals("someName", event.getNewName()); assertTrue(event.isNameChange()); }