@Test public void testDuplicateAttachId() throws Exception { projectSeeds.add(productSeed("product.id.1")); projectSeeds.add(productSeed("product.id.2")); subject = new ProductConfig(null, projectSeeds); assertEquals(false, subject.uniqueAttachIds()); }
public boolean uniqueAttachIds() { Set<String> attachIDs = new HashSet<>(); for (Product product : products) { if (!attachIDs.contains(product.getAttachId())) { attachIDs.add(product.getAttachId()); } else { return false; } } return true; }
ProductConfig { public boolean uniqueAttachIds() { Set<String> attachIDs = new HashSet<>(); for (Product product : products) { if (!attachIDs.contains(product.getAttachId())) { attachIDs.add(product.getAttachId()); } else { return false; } } return true; } }
ProductConfig { public boolean uniqueAttachIds() { Set<String> attachIDs = new HashSet<>(); for (Product product : products) { if (!attachIDs.contains(product.getAttachId())) { attachIDs.add(product.getAttachId()); } else { return false; } } return true; } ProductConfig(List<Product> userConfig, Collection<DependencySeed> projectSeeds); }
ProductConfig { public boolean uniqueAttachIds() { Set<String> attachIDs = new HashSet<>(); for (Product product : products) { if (!attachIDs.contains(product.getAttachId())) { attachIDs.add(product.getAttachId()); } else { return false; } } return true; } ProductConfig(List<Product> userConfig, Collection<DependencySeed> projectSeeds); boolean uniqueAttachIds(); List<Product> getProducts(); }
ProductConfig { public boolean uniqueAttachIds() { Set<String> attachIDs = new HashSet<>(); for (Product product : products) { if (!attachIDs.contains(product.getAttachId())) { attachIDs.add(product.getAttachId()); } else { return false; } } return true; } ProductConfig(List<Product> userConfig, Collection<DependencySeed> projectSeeds); boolean uniqueAttachIds(); List<Product> getProducts();  }