### Question:
JpaEntityService implements EntityService { @Override public void update(String id, Map<String, Object> entity) { create(id, entity); } JpaEntityService(EntityManager em, ModelToJSONMapConverter<T> converter, Class<T> entityType); @Override StreamingOutput getAll(Integer from, Integer size, final String[] fieldsToRemove); @Override List<Map<String, Object>> getAll(); @Override Map<String, Object> get(String id); @Override String create(Map<String, Object> entity); @Override void create(String id, Map<String, Object> entity); @Override void update(String id, Map<String, Object> entity); @Override void delete(String id); @Override ListRequest listRequestInit(); @Override ListRequest listRequestNext(ListRequest previous);  }### Answer:
@Test public void update() { JpaEntityService<Contributor> tested = new JpaEntityService<Contributor>(em, new ContributorConverter(), Contributor.class); try { em.getTransaction().begin(); Map<String, Object> entity = new LinkedHashMap<String, Object>(); entity.put("testkey1", "test \n value 1"); entity.put("testkey2", "test \t value 2"); String id = "gdfgdgadfgearg"; tested.update(id, entity); entity.put("testkey3", "test value 3"); String id2 = "yuiyujfgrtjdfg"; tested.update(id2, entity); em.getTransaction().commit(); em.getTransaction().begin(); Contributor c = em.find(Contributor.class, id); Assert.assertNotNull(c); Assert.assertEquals("{\"testkey1\":\"test \\n value 1\",\"testkey2\":\"test \\t value 2\"}", c.getValue()); Contributor c2 = em.find(Contributor.class, id2); Assert.assertNotNull(c2); Assert.assertEquals( "{\"testkey1\":\"test \\n value 1\",\"testkey2\":\"test \\t value 2\",\"testkey3\":\"test value 3\"}", c2.getValue()); em.getTransaction().commit(); em.getTransaction().begin(); entity.put("testkey4", "test value 4"); tested.update(id, entity); em.getTransaction().commit(); em.getTransaction().begin(); c = em.find(Contributor.class, id); Assert.assertNotNull(c); Assert .assertEquals( "{\"testkey1\":\"test \\n value 1\",\"testkey2\":\"test \\t value 2\",\"testkey3\":\"test value 3\",\"testkey4\":\"test value 4\"}", c.getValue()); em.getTransaction().commit(); } catch (Exception ex) { em.getTransaction().rollback(); ex.printStackTrace(); Assert.fail("Exception during testPersistence"); } }