AatsrLevel1ProductFactory extends SlstrLevel1ProductFactory { @Override protected Product findMasterProduct() { if (masterProduct != null) { return masterProduct; } masterProduct = findMasterProduct(getOpenProductList()); return masterProduct; } AatsrLevel1ProductFactory(AatsrLevel1ProductReader productReader);   }
@Test public void testFindMasterProduct() throws Exception { final ArrayList<Product> openProductList = new ArrayList<>(); openProductList.add(new Product("p1", "t", 12,14)); openProductList.add(new Product("p2", "t", 12,15)); openProductList.add(new Product("p3", "t", 13,15)); openProductList.add(new Product("p4", "t", 13,14)); openProductList.add(new Product("p5", "t", 12,14)); final Product masterProduct = AatsrLevel1ProductFactory.findMasterProduct(openProductList); assertEquals("p3", masterProduct.getName()); }