ExcelSheetItemWriter extends AbstractItemCountingItemStreamItemWriter<T> implements
        ResourceAwareItemStreamWriter<T>,
        ResourceAwareItemWriterItemStream<T>,
        InitializingBean { @Override public void open(ExecutionContext executionContext) throws ItemStreamException { super.open(executionContext); if (executionContext.containsKey(getExecutionContextKey(ROW_TO_SKIP_KEY))) { rowsToSkip = executionContext.getInt(getExecutionContextKey(ROW_TO_SKIP_KEY)); } if (executionContext.containsKey(getExecutionContextKey(SHEET_INDEX_KEY))) { sheetIndex = executionContext.getInt(getExecutionContextKey(SHEET_INDEX_KEY)); } }  @Override void afterPropertiesSet(); @Override void open(ExecutionContext executionContext); @Override void doOpen(); @Override boolean doWrite(T item); @Override void doClose(); @Override void update(ExecutionContext executionContext); void setRowsToSkip(int rowsToSkip); void setRowAggregator(RowAggregator<T> rowAggregator); void setSheetIndex(int sheetIndex); @Override void setResource(Resource resource); void setTemplate(Resource template); void setShouldDeleteIfExists(boolean shouldDeleteIfExists);  }
@Test(expected = ItemStreamException.class) @Ignore public void testIOExceptionOnClose() throws Exception { writer.open(executionContext); try (FileOutputStream outputStream = new FileOutputStream(Paths.get(CURRENT_PATH, "output.xls").toFile())) { try (FileLock ignored = outputStream.getChannel().lock()) { writer.close(); } } }