class PatternList extends ArrayList<String> {

        private static final long serialVersionUID = -6883390970972775838L;

        private final Filter owner;

        public PatternList(Filter owner) {
            this.owner = owner;
        }

        @Override
        public boolean add(String pattern) {<FILL_FUNCTION_BODY>}
    }

            boolean ret = super.add(pattern);
            if (ret) {
                owner.addPattern(pattern);
            }
            return ret;
        
<no_super_class>