FingerPrint implements Serializable { public boolean registerProduct(final ProductInfo productInfo) { int initialSize = productInfoSet.size(); productInfoSet.add(productInfo); return initialSize != productInfoSet.size(); } FingerPrint(); boolean registerProduct(final ProductInfo productInfo); Collection<ProductInfo> getProducts();  }
@Test public void duplicateTest() { FingerPrint fingerPrint = new FingerPrint(); fingerPrint.registerProduct(productInfo); Assert.assertFalse(fingerPrint.registerProduct(productInfo)); }