### Question:
CreateExcelSpreadsheetAnalyzer extends AbstractOutputWriterAnalyzer implements HasLabelAdvice { private String fixSheetName(String sheet) { for (final char c : SHEET_NAME_ILLEGAL_CHARS) { while (sheet.indexOf(c) != -1) { sheet = sheet.replace(c, '-'); } } if (sheet.length() > SHEET_NAME_MAX_LENGTH) { sheet = sheet.substring(0, SHEET_NAME_MAX_LENGTH); } return sheet; }  @Initialize void initTempFile(); @Override String getSuggestedLabel(); @Validate void validate(); @Override void configureForFilterOutcome(final AnalysisJobBuilder ajb, final FilterDescriptor<?, ?> descriptor,
            final String categoryName); @Override void configureForTransformedData(final AnalysisJobBuilder ajb, final TransformerDescriptor<?> descriptor); @Override OutputWriter createOutputWriter(); void setFile(final File file); void setSheetName(final String sheetName); @Close void close(); static final String PROPERTY_FILE; static final String PROPERTY_SHEET_NAME; static final String PROPERTY_OVERWRITE_SHEET_IF_EXISTS; }### Answer:
@Test public void testFixSheetName() throws Exception { final Datastore datastore = EasyMock.createMock(Datastore.class); final FilterDescriptor<?, ?> filterDescriptor = EasyMock.createMock(FilterDescriptor.class); EasyMock.expect(datastore.openConnection()).andReturn(null); EasyMock.expect(datastore.getName()).andReturn("data:store"); EasyMock.expect(filterDescriptor.getDisplayName()).andReturn("my fil-ter"); EasyMock.replay(datastore, filterDescriptor); final AnalysisJobBuilder ajb = new AnalysisJobBuilder(new DataCleanerConfigurationImpl()); ajb.setDatastore(datastore); final CreateExcelSpreadsheetAnalyzer analyzer = new CreateExcelSpreadsheetAnalyzer(); analyzer.configureForFilterOutcome(ajb, filterDescriptor, "OUT.COME"); assertEquals("data-store-my fil-ter-OUT-COME", analyzer.sheetName); EasyMock.verify(datastore, filterDescriptor); }