public static void requireMatchingUuids(final String uuid, final HasUuid object) {
        if (object == null) {
            throw badRequest("Object is null");
        }
        if (uuid == null) {
            throw badRequest("uuid is null");
        }
        // Allow for the object not having a uuid in which case the string uuid wins
        if (object.getUuid() != null && !object.getUuid().equals(uuid)) {
            throw badRequest("UUID " + uuid + " doesn't match UUID in object " + object.getUuid());
        }
    }
Used to validate a request argument and throw a {@link BadRequestException} if it is null
stroom-util/src/main/java/stroom/util/rest/RestUtil.java