StaxParser { public void parse(File xmlFile) throws XMLStreamException { try(FileInputStream input = new FileInputStream(xmlFile)) { parse(inf.rootElementCursor(input)); } catch (IOException e) { throw new XMLStreamException(e); } } StaxParser(XmlStreamHandler streamHandler); void parse(File xmlFile);  }
@Test public void should_fail_parsing_ig_file_does_not_exist() throws Exception { thrown.expect(XMLStreamException.class); StaxParser parser = new StaxParser(rootCursor -> {}); parser.parse(new File("fake.xml")); }