PixelCsvWriter implements CsvWriter { @Override public boolean isValidInput(Object... input) { return input != null && input.length == 2 && input[0] instanceof Product && input[1] instanceof PixelPos[]; } PixelCsvWriter(WriteStrategy writer, OutputFormatStrategy targetFormat); @Override void writeCsv(Object... input); @Override boolean isValidInput(Object... input);  }
@Test public void testIsValidInput() throws Exception { final PixelCsvWriter csvWriter = new PixelCsvWriter(null, null); final Product testProduct = new Product("testProduct", "someType", 10, 10); final PixelPos[] pixelPositions = new PixelPos[10]; assertFalse(csvWriter.isValidInput()); assertFalse(csvWriter.isValidInput("", "", "")); assertFalse(csvWriter.isValidInput(testProduct, new PixelPos(), new PixelPos())); assertTrue(csvWriter.isValidInput(testProduct, pixelPositions)); }