  @Test
  public void testExtract_IOExceptionThrown_returnsEmptyMap() throws IOException {

    InputStream mockInputStream = mock(InputStream.class);
    String message = "Intentionally throwing IOException";
    IOException exception = new IOException(message);
    when(mockInputStream.read()).thenThrow(exception);
    Map<String, String> ret = xmlFieldExtractor.extract(mockInputStream, new String[] {"trigger"});
    assertEquals(0, ret.size());
    verify(logger, times(1)).warn(contains("input"), same(exception));
  }