@Test
public void testReadElement() throws Exception {

    ErrorMessage errorMessage = new ErrorMessage();
    ArrayList<IEbmsError> errors = new ArrayList<>();
    EbmsError ebmsError = new EbmsError();
    ebmsError.setCategory("");
    ebmsError.setSeverity(IEbmsError.Severity.failure);
    ebmsError.setErrorCode("some_error_code");
    errors.add(ebmsError);
    errorMessage.setErrors(errors);
    OMElement esElement =
            ErrorSignalElement.createElement(headerBlock, errorMessage);
    errorMessage = ErrorSignalElement.readElement(esElement);
    assertNotNull(errorMessage);
    Iterator<IEbmsError> it = errorMessage.getErrors().iterator();
    assertTrue(it.hasNext());
    ebmsError = (EbmsError)it.next();
    assertEquals("some_error_code", ebmsError.getErrorCode());
    assertEquals(IEbmsError.Severity.failure, ebmsError.getSeverity());
}