### Question:
RawRowIteratorFactory { public static RawRowIterator createIterator(Path path) { return createIterator(path, null, null); } private  RawRowIteratorFactory(); static RawRowIterator createIterator(Path path); static RawRowIterator createIterator(Path path, SheetConfig sheetConfig); static RawRowIterator createIterator(Path path, ExcelExtension excelExtension); static RawRowIterator createIterator(
      Path path, ExcelExtension excelExtension, SheetConfig sheetConfig); static RawRowIterator createIterator(
      InputStream inputStream, ExcelExtension excelExtension); static RawRowIterator createIterator(
      InputStream inputStream, ExcelExtension excelExtension, SheetConfig sheetConfig);  }### Answer:
@Test public void testGettingInstanceFromCsvPathShouldBeCsvRowIteratorType() { assertTrue(RawRowIteratorFactory.createIterator(CSV_FILE) instanceof CsvRowIterator); }
@Test public void testGettingInstanceFromXlsxPathShouldBeXlsxRowIteratorType() { assertTrue(RawRowIteratorFactory.createIterator(XLSX_FILE) instanceof XlsxRowIterator); }
@Test(expected = UnsupportedFileTypeException.class) public void testGettingInstanceFromUnsupportedPathShouldThrowException() { RawRowIteratorFactory.createIterator(UNSUPPORTED_FILE); }
@Test(expected = UncheckedIOException.class) public void testGettingInstanceOfPathNotFoundShouldThrowException() { RawRowIteratorFactory.createIterator(NON_EXISTENT_FILE); }
@Test(expected = NullPointerException.class) public void testGettingInstanceFromNullPathSpecifyingExtensionShouldThrowException() throws Exception { RawRowIteratorFactory.createIterator((Path) null, ExcelExtension.CSV); }
@Test(expected = NullPointerException.class) public void testGettingInstanceFromNullPathShouldThrowException() throws Exception { RawRowIteratorFactory.createIterator(null); }
@Test public void testGettingInstanceFromUnsupportedPathExplicitlyChoosingCsvShouldBeCsvRowIteratorType() { assertTrue( RawRowIteratorFactory.createIterator(CSV_FILE_WITHOUT_EXTENSION, ExcelExtension.CSV) instanceof CsvRowIterator); }
@Test public void testGettingInstanceFromUnsupportedPathExplicitlyChoosingXlsxShouldBeXlsxRowIteratorType() { assertTrue( RawRowIteratorFactory.createIterator(XLSX_FILE_WITHOUT_EXTENSION, ExcelExtension.XLSX) instanceof XlsxRowIterator); }
@Test(expected = UnsupportedFileTypeException.class) public void testGettingInstanceFromUnsupportedPathWithoutExplicitlyChoosingFileTypeShouldThrowException() { RawRowIteratorFactory.createIterator(CSV_FILE_WITHOUT_EXTENSION); }
@Test public void testGettingInstanceFromInputStreamExplicitlyChoosingCsvShouldBeCsvRowIteratorType() throws Exception { InputStream in = Files.newInputStream(CSV_FILE); assertTrue( RawRowIteratorFactory.createIterator(in, ExcelExtension.CSV) instanceof CsvRowIterator); }
@Test public void testGettingInstanceFromInputStreamExplicitlyChoosingXlsxShouldBeXlsxRowIteratorType() throws Exception { InputStream in = Files.newInputStream(XLSX_FILE); assertTrue( RawRowIteratorFactory.createIterator(in, ExcelExtension.XLSX) instanceof XlsxRowIterator); }
@Test(expected = NullPointerException.class) public void testGettingInstanceFromInputStreamWithoutExplicitlyChoosingFileTypeShouldThrowException() throws Exception { InputStream in = Files.newInputStream(CSV_FILE); RawRowIteratorFactory.createIterator(in, null); }
@Test(expected = NullPointerException.class) public void testGettingInstanceFromNullInputStreamShouldThrowException() throws Exception { RawRowIteratorFactory.createIterator((InputStream) null, ExcelExtension.CSV); }