fact().register(Child.class);
Trivial triv = new Trivial("foo", 5);
Key<Trivial> parentKey = ofy().save().entity(triv).now();
Child child = new Child(parentKey, "cry");
Key<Child> childKey = ofy().save().entity(child).now();
assert childKey.getParent().equals(parentKey);
Child fetched = ofy().load().key(childKey).now();
assert fetched.getParent().equals(child.getParent());
assert fetched.getChildString().equals(child.getChildString());
// Let's make sure we can get it back from an ancestor query
Child queried = ofy().load().type(Child.class).ancestor(parentKey).first().now();
assert queried.getParent().equals(child.getParent());
assert queried.getChildString().equals(child.getChildString());
}