doc.insertText(Point.<Node> end(p), "hi");
Element aElement =
doc.createElement(Point.<Node>end(p), "a", Collections.<String, String> emptyMap());
doc.insertText(Point.start(doc, aElement), "stuff");
Text hi = doc.asText(doc.getFirstChild(p));
Text stuff = doc.asText(aElement.getFirstChild());
assertEquals(Point.inText(hi, 2), DocHelper.normalizePoint(Point.<Node> inText(hi, 2), doc));
assertEquals(Point.inText(hi, 2), DocHelper.normalizePoint(Point.<Node> inElement(p, aElement),
doc));
// In the future, we might want to move the caret out from inline elements.
assertEquals(Point.inText(stuff, 0), DocHelper.normalizePoint(Point.<Node> inText(stuff, 0),
doc));
assertEquals(Point.inText(stuff, stuff.getLength()), DocHelper.normalizePoint(Point
.<Node> inText(stuff, stuff.getLength()), doc));
}