/** * Ensures that the uuid of the parent of delegate is the same as the passed in parentUniqueId * * @param delegate * @param parentUniqueId * @throws ObjectMismatchException */ private void testParent(T delegate, String parentUniqueId) throws ObjectMismatchException { P parent = getParent(delegate); String test = getParentResource().getUniqueId(parent); if (!OpenmrsUtil.nullSafeEquals(test, parentUniqueId)) throw new ObjectMismatchException(parentUniqueId + " does not match " + parent, null); }