private final Map<UUID, HasUuid> data = FlatPackCollections.mapForLookup();
@Test
public void test() throws IOException {
Employee e1 = makeEmployee();
Employee e2 = makeEmployee();
String e2Name = e2.getName();
Employee e1Send = makeEmployee();
e1Send.setUuid(e1.getUuid());
e1Send.setName("Should see this");
Employee e2Send = makeEmployee();
e2Send.setUuid(e2.getUuid());
e2Send.setName("Should not see this");
data.put(e1.getUuid(), e1);
data.put(e2.getUuid(), e2);
// Update self
Employee updated = deepPack(Employee.class, e1Send, new TestPrincipal(e1.getUuid()));
assertEquals("Should see this", updated.getName());
// Try updating one employee as another
updated = deepPack(Employee.class, e2Send, new TestPrincipal(e1.getUuid()));
assertEquals(e2Name, updated.getName());
}