class TransformationTemplate implements TransformationUtilityList {

    @Override
    public final String add(TransformationUtility utility) {
        if (utility.getParent() != null) {
            String exceptionMessage = String.format("Invalid attempt to add already registered transformation utility %s to transformation template %s", utility.getName(), name);
            throw new  TransformationDefinitionException(exceptionMessage);
        }
        // TODO
        // Here I should check the TUs inside of utilities groups and multiple operations as well
        if (utility.getName() != null && utilityNames.contains(utility.getName())) {
            String exceptionMessage = String.format("Invalid attempt to add transformation utility %s to transformation template %s. Its name is already registered", utility.getName(), name);
            throw new  TransformationDefinitionException(exceptionMessage);
        }
        if (!utility.isFileSet()) {
            String exceptionMessage;
            if (utility.getName() == null) {
                exceptionMessage = "Neither absolute, nor relative path, have been set for this transformation utility";
            } else {
                exceptionMessage = String.format("Neither absolute, nor relative path, have been set for transformation utility %s", utility.getName());
            }
            throw new  TransformationDefinitionException(exceptionMessage);
        }

        int order;
        synchronized (this) {
            utilityList.add(utility);

            // This is the order of execution of this utility
            // Not to be confused with the index of the element in the list,
            // Since the first utility will be assigned order 1 (not 0)
            order = utilityList.size();
        }

        utility.setParent(this, order);

        utilityNames.add(utility.getName());

        return utility.getName();
    }

    public  TransformationTemplate();

}