@Test
public void persistUpdateToSameChannel() {
final String channelId = UUID.randomUUID().toString();
final String uaid = UUIDUtil.newUAID();
final UserAgentDTO userAgent = persist(uaid, channelId, 10, "/endpoint/" + channelId);
entityManager.getTransaction().begin();
final AckDTO update = new AckDTO(userAgent, channelId, 10);
entityManager.persist(update);
entityManager.getTransaction().commit();
entityManager.getTransaction().begin();
final UserAgentDTO userAgentToUpdate = entityManager.find(UserAgentDTO.class, uaid);
final AckDTO newUpdate = new AckDTO(userAgent, channelId, 11);
userAgentToUpdate.setAcks(new HashSet<AckDTO>(Arrays.asList(newUpdate)));
entityManager.merge(userAgentToUpdate);
entityManager.getTransaction().commit();
entityManager.getTransaction().begin();
final AckDTO updated = entityManager.find(AckDTO.class, channelId);