### Question:
JpaDataStore implements DataStore { @Override public Set<Ack> getUnacknowledged(final String uaid) { final JpaOperation<Set<Ack>> getUnacks = new JpaOperation<Set<Ack>>() { @Override public Set<Ack> perform(final EntityManager em) { final UserAgentDTO userAgent = em.find(UserAgentDTO.class, uaid); if (userAgent == null) { return Collections.emptySet(); } final HashSet<Ack> acks = new HashSet<Ack>(); for (AckDTO ackDTO : userAgent.getAcks()) { acks.add(new AckImpl(ackDTO.getChannelId(), ackDTO.getVersion())); } return acks; } }; return jpaExecutor.execute(getUnacks); } JpaDataStore(final String persistenceUnit); @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel channel); @Override Channel getChannel(final String channelId); @Override void removeChannels(final Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override void removeChannels(final String uaid); @Override String updateVersion(final String endpointToken, final long version); @Override String saveUnacknowledged(final String channelId, final long version); @Override Set<Ack> getUnacknowledged(final String uaid); @Override Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked);  }### Answer:
@Test public void getUnacknowledgedNoChannelsSavedYet() { final String uaid = UUIDUtil.newUAID(); final Set<Ack> storedUpdates = jpaDataStore.getUnacknowledged(uaid); assertThat(storedUpdates.size(), is(0)); }
@Test public void getUnacknowledged() throws ChannelNotFoundException { final String uaid = UUIDUtil.newUAID(); final Channel channel1 = newChannel(uaid, UUID.randomUUID().toString(), 1); final Channel channel2 = newChannel(uaid, UUID.randomUUID().toString(), 2); jpaDataStore.saveChannel(channel1); jpaDataStore.saveChannel(channel2); jpaDataStore.saveUnacknowledged(channel1.getChannelId(), 10); jpaDataStore.saveUnacknowledged(channel2.getChannelId(), 10); assertThat(jpaDataStore.getUnacknowledged(uaid).size(), is(2)); }