@Test
public void testGetNextInputStream() {

	// write input files & noise files
	writeSimpleFiles(BASE_DIR,"txt",NUM_FILES_IN_DIR);
				
	// init with path to input dir
	streamSource.init(config, BASE_DIR, "txt");
			
	// call getNextInputStream & assertions
	Set<String> contents = new HashSet<String>();
	for (int i=1; i<=NUM_FILES_IN_DIR; i++) {
		contents.add(Integer.toString(i));
	}
	for (int i=0; i< NUM_FILES_IN_DIR; i++) {
		InputStream inStream = streamSource.getNextInputStream();
		assertNotNull("Unexpected end of input stream list.",inStream);
		
		BufferedReader rd = new BufferedReader(new InputStreamReader(inStream));
		String inputRead = null;
		try {
			inputRead = rd.readLine();
		} catch (IOException ioe) {
			fail("Fail reading from stream at index:"+i + ioe.getMessage());
		}
		assertTrue("File content is incorrect.",contents.contains(inputRead));
		Iterator<String> it = contents.iterator();
		while (it.hasNext()) {
			if (it.next().equals(inputRead)) {
				it.remove();
				break;
			}
		}
	}
	
	// assert that another call to getNextInputStream will return null
	assertNull("Call getNextInputStream after the last file did not return null.",streamSource.getNextInputStream());
}