Father f = new Father();
f.foo = "foo";
ofy().save().entity(f).now();
ChildWithGroup ch = new ChildWithGroup();
ch.father = Ref.create(Key.create(f));
ch.bar = "bar";
ofy().save().entity(ch).now();
ofy().clear();
// This should get an uninitialized ref
ChildWithGroup fetched = ofy().load().entity(ch).now();
assert fetched.father.key().getId() == f.id;
assert !fetched.father.isLoaded();
// This should get a filled in ref
ChildWithGroup fetched2 = ofy().load().group(Group.class).key(Key.create(ch)).now();
fetched2.father.get();
assert fetched2.father.get().id.equals(f.id);
assert fetched2.father.get().foo.equals(f.foo);
}