UpdateOp { public UpdateOp shallowCopy(String id) { return new UpdateOp(id, isNew, isDelete, changes, conditions); } UpdateOp(@NotNull String id, boolean isNew);   UpdateOp(@NotNull String id,
             boolean isNew,
             boolean isDelete,
             @NotNull Map<Key, Operation> changes,
             @Nullable Map<Key, Condition> conditions); UpdateOp shallowCopy(String id); UpdateOp copy(); @NotNull String getId(); boolean isNew(); void setNew(boolean isNew); Map<Key, Operation> getChanges(); Map<Key, Condition> getConditions(); boolean hasChanges(); void remove(@NotNull String property); void removeMapEntry(@NotNull String property, @NotNull Revision revision); void set(String property, long value); void set(String property, boolean value); void set(String property, String value); void increment(@NotNull String property, long value); UpdateOp getReverseOperation(); @Override String toString();  }
@Test public void shallowCopy() { UpdateOp op1 = new UpdateOp("id", false); op1.set("p", "value"); UpdateOp op2 = op1.shallowCopy("id"); assertTrue(op2.hasChanges()); assertEquals(1, op2.getChanges().size()); assertEquals(0, op2.getConditions().size()); Revision r = Revision.newRevision(1); op1.containsMapEntry("e", r, true); op2 = op1.shallowCopy("id"); assertEquals(1, op2.getConditions().size()); }