}
@Test
public void removeAcknowledged() throws ChannelNotFoundException {
final String uaid = UUIDUtil.newUAID();
final Channel channel1 = newChannel(uaid, UUID.randomUUID().toString(), 10);
final Channel channel2 = newChannel(uaid, UUID.randomUUID().toString(), 22);
datastore.saveChannel(channel1);
datastore.saveChannel(channel2);
datastore.saveUnacknowledged(channel1.getChannelId(), channel1.getVersion());
datastore.saveUnacknowledged(channel2.getChannelId(), channel2.getVersion());
final Set<Ack> unacks = datastore.removeAcknowledged(uaid, acks(ack(channel1)));
assertThat(unacks, hasItem(ack(channel2)));
assertThat(unacks.size(), is(1));
assertThat(datastore.removeAcknowledged(uaid, unacks).size(), is(0));
}