FeatureCsvWriter implements CsvWriter { @Override public boolean isValidInput(Object... input) { if(input == null) { return false; } if (input.length == 2 && (input[0] instanceof SimpleFeatureType && input[1] instanceof FeatureCollection)) { return true; } else if (input.length >= 2 && input[0] instanceof SimpleFeatureType) { for (int i = 1; i < input.length; i++) { if (!(input[i] instanceof SimpleFeature)) { return false; } } return true; } return false; } FeatureCsvWriter(WriteStrategy writer, OutputFormatStrategy targetFormat); @Override void writeCsv(Object... input); @Override boolean isValidInput(Object... input);  }
@Test public void testIsValidInput() throws Exception { final FeatureCsvWriter csvWriter = new FeatureCsvWriter(null, null); final SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName(new NameImpl("")); final SimpleFeatureType simpleFeatureType = builder.buildFeatureType(); assertTrue(csvWriter.isValidInput(simpleFeatureType, new DefaultFeatureCollection("id", simpleFeatureType))); final FeatureTypeImpl featureType = new FeatureTypeImpl(new NameImpl(""), null, null, false, null, null, null); assertFalse(csvWriter.isValidInput(featureType, new DefaultFeatureCollection("id", simpleFeatureType))); assertFalse(csvWriter.isValidInput()); }