JCR-2439: More utility methods in JcrUtils Make the getOrAddNode(parent, name, type) method ensure that the returned node matches the given type.