class OptionObjectBundleHook extends AbstractObjectBundleHook {

    @Override
    public <T extends IdentifiableObject> List<ErrorReport> validate( T object, ObjectBundle bundle )
    {
        List<ErrorReport> errors = new ArrayList<>();

        if ( !(object instanceof Option) ) return new ArrayList<>();

        final Option option = (Option) object;

        if ( option.getOptionSet() != null )
        {
            OptionSet optionSet = bundle.getPreheat().get( bundle.getPreheatIdentifier(), OptionSet.class, option.getOptionSet() );

            errors.addAll( checkDuplicateOption( optionSet, option ) );
        }

        return errors;
    }

}