### Question:
ItemServiceImpl implements ItemService { @Override public int updateItem(Item item) { String id = item.getId(); Query query = em.createQuery( "UPDATE Item a SET a.name = :name , a.category = :category , a.state = :state, a.description = :description, a.price = :price " + "WHERE a.id = :wantedid"); query.setParameter("wantedid", id).setParameter("name", item.getName()).setParameter("category", item.getCategory()).setParameter("state", item.getState()).setParameter("description", item.getDescription()).setParameter("price", item.getPrice()).executeUpdate(); return 0; }  @Override List<Item> getBySearch(String keyword, String category, String state, float sprice, float fprice, int p); @Override List<Item> getHighlight(String user); @Override List<Item> getAll(); @Override String create(Item i); @Override void removeItem(Item item); @Override int updateItem(Item item); @Override List<Item> getItem(String usrID); @Override List<Item> getItemid(String id); void addItem(Item item);  }### Answer:
@Test void updateItemTest() { Item i = new Item("18248", "uifei", 4, "livre", "doenfr", "neuf",""); em.persist(i); Item newi = new Item(i.getId(),"18248", "ciao", 4, "livre", "doenfr", "neuf",""); itemserviceimpl.updateItem(newi); i.setName("ciao"); assertEquals(newi, itemserviceimpl.getBySearch("ciao", "livre", "neuf", 3, 5, 1).get(0)); }