store.put("bar", createPerson("bar@example.com", "Mr Bar"));
Collection<StoreEntry> entries = store.getAll();
assertEquals(entries.size(), 2);
StoreEntry fooEntry = Iterables.find(entries, new Predicate<StoreEntry>()
{
@Override
public boolean apply(StoreEntry input)
{
return input.getId().equals("foo");
}
});
assertEquals(fooEntry.getPerson(), createPerson("foo@example.com", "Mr Foo"));
StoreEntry barEntry = Iterables.find(entries, new Predicate<StoreEntry>()
{
@Override
public boolean apply(StoreEntry input)
{
return input.getId().equals("bar");
}
});
assertEquals(barEntry.getPerson(), createPerson("bar@example.com", "Mr Bar"));
}