### Question:
ItemNameReader { public String getName() { return name; } private  ItemNameReader(ItemAwareElement element); static ItemNameReader from(ItemAwareElement element); String getName();  }### Answer:
@Test public void testGetPropertyName() { when(property.getName()).thenReturn(NAME); when(property.getId()).thenReturn(ID); testGetName(NAME, property); }
@Test public void testGetPropertyID() { when(property.getName()).thenReturn(null); when(property.getId()).thenReturn(ID); testGetName(ID, property); }
@Test public void testGetDataInputName() { when(dataInput.getName()).thenReturn(NAME); when(dataInput.getId()).thenReturn(ID); testGetName(NAME, dataInput); }
@Test public void testGetDataInputID() { when(dataInput.getName()).thenReturn(null); when(dataInput.getId()).thenReturn(ID); testGetName(ID, dataInput); }
@Test public void testGetDataOutputName() { when(dataOutput.getName()).thenReturn(NAME); when(dataOutput.getId()).thenReturn(ID); testGetName(NAME, dataOutput); }
@Test public void testGetDataOutputID() { when(dataOutput.getName()).thenReturn(null); when(dataOutput.getId()).thenReturn(ID); testGetName(ID, dataOutput); }
@Test public void testGetDataObject() { when(dataObject.getName()).thenReturn(null); when(dataObject.getId()).thenReturn(ID); testGetName(ID, dataObject); }