StatisticsOp extends Operator { static boolean isProductAlreadyOpened(List<Product> products, File file) { for (Product product : products) { if (product.getFileLocation().getAbsolutePath().equals(file.getAbsolutePath())) { return true; } } return false; }  @Override void initialize(); static String[] getAlgorithmNames(int[] percentiles); static final String DATETIME_PATTERN; static final String MAXIMUM; static final String MINIMUM; static final String MEDIAN; static final String AVERAGE; static final String SIGMA; static final String MAX_ERROR; static final String TOTAL; static final String PERCENTILE_PREFIX; static final String PERCENTILE_SUFFIX; static final String DEFAULT_PERCENTILES; static final int[] DEFAULT_PERCENTILES_INTS; }
@Test public void testProductAlreadyOpened() { final File file = new File("test.file"); final Product product = new Product("name", "type", 20, 40); product.setFileLocation(file); final ArrayList<Product> products = new ArrayList<>(); products.add(product); assertTrue(StatisticsOp.isProductAlreadyOpened(products, file)); assertFalse(StatisticsOp.isProductAlreadyOpened(products, new File("other.path"))); }