### Question:
NonUniqueResultException extends PersistenceException { public boolean hasResults() { return hasResults; } NonUniqueResultException(final Class<? extends Item> itemClass, final Collection<? extends Item> items); @Override String getMessage(); boolean hasResults();  }### Answer:
@Test public void shouldCreateException_withEmptyIdsAndClass() { final Class<Item> itemClass = Item.class; final Collection<Item> itemArray = new ArrayList<Item>(); final NonUniqueResultException nonUniqueResultException = new NonUniqueResultException(itemClass, itemArray); assertNotNull(nonUniqueResultException); assertFalse(nonUniqueResultException.hasResults()); }
@Test public void shouldCreateException_withIdsAndClass() { final Class<Item> itemClass = Item.class; final Item stubItem = new StubItem(); final Item stubItem2 = new StubItem(); final Collection<Item> itemArray = Arrays.asList(stubItem, stubItem2); final NonUniqueResultException nonUniqueResultException = new NonUniqueResultException(itemClass, itemArray); assertNotNull(nonUniqueResultException); assertTrue(nonUniqueResultException.hasResults()); }