### Question:
XmiReader { protected static final Identifier getIdRef(final XMLStreamReader reader) throws XmiMissingAttributeException { final String value = reader.getAttributeValue(GLOBAL_NAMESPACE, XmiAttributeName.IDREF.getLocalName()); if (value != null) { return Identifier.fromString(value); } else { throw new XmiMissingAttributeException(XmiAttributeName.IDREF.getLocalName()); } }  static final Model readModel(final File file); static final Model readModel(final InputStream stream); static final Model readModel(final String fileName);  }### Answer:
@Test public void testGetIdRefHappyPath() { String id = "ID1234567890"; when(mockReader.getAttributeValue(any(String.class), any(String.class))).thenReturn(id); assertTrue(XmiReader.getIdRef(mockReader).toString().equals(id)); }
@Test(expected = XmiMissingAttributeException.class) public void testGetIdRefSadPath() { when(mockReader.getAttributeValue(any(String.class), any(String.class))).thenReturn(null); XmiReader.getIdRef(mockReader); }