### Question:
ExcelToTabular { public List<File> process(final URL inputUrl) { final File spreadsheet = createTempFile(this); final ByteSource source = asByteSource(inputUrl); final ByteSink sink = asByteSink(spreadsheet); try { source.copyTo(sink); } catch (final IOException e) { throw new ExcelParsingException("Could not retrieve input URL: " + inputUrl, e); } try { final Worksheets worksheets = new Worksheets(create(spreadsheet)); final List<File> outputs = new ArrayList<>(size(worksheets)); log.trace("Translating sheets with data."); for (final FilteredSheet sheet : worksheets) { final File tabularFile = createTempFile(this); outputs.add(tabularFile); try (PrintStream output = new PrintStream(tabularFile)) { for (final Row row : sheet) { output.println(new TabularRow(row, quote, delimiter)); } } } spreadsheet.delete(); return outputs; } catch (final InvalidFormatException e) { throw new ExcelParsingException( "Could not parse input spreadsheet because it is not in a format registered to Apache POI: " + inputUrl, e); } catch (final IOException e) { throw new ExcelParsingException("Could not translate input spreadsheet: " + inputUrl, e); } }  List<File> process(final URL inputUrl); void setDelimiter(final String delimiter); void setQuoteChar(final String quoteChar);  }### Answer:
@Test(expected = ExcelParsingException.class) public void testBadUrl() throws MalformedURLException { final File testFile = createTempFile(this); testFile.delete(); new ExcelToTabular().process(testFile.toURI().toURL()); }
@Test(expected = ExcelParsingException.class) public void testBadSheet() throws IOException { final File testFile = createTempFile(this); write("THIS IS NOT A SPREADSHEET", testFile, UTF_8); new ExcelToTabular().process(testFile.toURI().toURL()); }
@Test(expected = ExcelParsingException.class) public void testBadFormatSheet() throws IOException { final File testFile = new File("src/test/resources/xls/bad-format-spreadsheet.xlsx"); new ExcelToTabular().process(testFile.toURI().toURL()); }
@Test public void testOneLineSheet() throws IOException { final File testFile = new File("src/test/resources/xls/one-line.xls"); final List<File> results = new ExcelToTabular().process(testFile.toURI().toURL()); assertEquals(1, results.size()); final File result = results.get(0); final List<String> lines = readLines(result, UTF_8); assertEquals(1, lines.size()); final String line = lines.get(0); assertEquals("\"Value\",1,\"Value\"", line); }