@Test
public void testParseAndStop() throws ParseException,
		CheckedOutOfMemoryError {

	final List<String> pages = new ArrayList<String> (2);
	PageHandler handler = new PageHandler() {
		public boolean handlePage(String pageText) {
			pages.add(pageText);
			return pages.size() >= 2;
		}
	};
	new PagingPdfParser(TestFiles.multi_page_pdf.get(), handler).run();
	assertEquals(2, pages.size());
	assertEquals("page 1" + Util.LS, pages.get(0));
	assertEquals("page 2" + Util.LS, pages.get(1));
}