class CheckSpec implements JsonObjectConvertible {

    final CheckSpec baseCompositeOver(final @NotNull CheckSpec that) {
        final CheckSpec composite = copyOf(that);
        // only leave impl OR inlineScript+inlineEngine set in the composite. Be sure to unset the
        // alternative in the composite to reduce confusion about which takes precedence downstream.
        if (this.getInlineScript() != null) {
            composite.setInlineScript(this.getInlineScript());
            composite.setInlineEngine(this.getInlineEngine());
            composite.setImpl(null);
        } else if (!isEmpty(this.getImpl())) {
            composite.setInlineScript(null);
            composite.setInlineEngine(null);
            composite.setImpl(this.getImpl());
        }
        composite.setConfig(JavaxJson.shallowMergeObjects(that.getConfig(), this.getConfig()));
        return composite;
    }

}