package loc.filter.filters.Aggregate;

import java.util.Arrays;

public abstract class AggregateFilter implements Filter {
	public Filter[] filters;

	public AggregateFilter(Filter[] filters) {
		this.filters = filters;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		AggregateFilter aggregateFilter = (AggregateFilter) o;

		// Probably incorrect - comparing Object[] arrays with Arrays.equals
		return Arrays.equals(filters, aggregateFilter.filters);
	}

	@Override
	public int hashCode() {
		return getPrefix() * 37 + Arrays.hashCode(filters);
	}

	@Override
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append(getPrefix());
		buffer.append('(');
		boolean first = true;
		for (Filter filter: filters) {
			if (!first){
				buffer.append(' ');
			}
			first = false;
			buffer.append(filter.toString());
		}
		buffer.append(')');
		return buffer.toString();
	}
}

@@ -43,110 +43,590 @@
 ort 
-java.util.Arrays;%0A%0Apublic abstract class AggregateFilter implements Filter %7B%0A%09public Filter%5B%5D filters;
+loc.FilterSequenceStringBuffer;%0Aimport loc.filter.Filter;%0Aimport loc.filter.FilterSerializer;%0A%0Aimport java.util.Arrays;%0A%0Apublic abstract class AggregateFilter implements Filter %7B%0A%09public Filter%5B%5D filters;%0A%0A%0A%09public static class Serializer implements FilterSerializer %7B%0A%09%09@Override%0A%09%09public AggregateFilter parse(String string) throws Exception %7B%0A%09%09%09return null;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public String serialize(Filter filter) throws Exception %7B%0A%09%09%09Filter%5B%5D filters = AggregateFilter.class.cast(filter).filters;%0A%09%09%09return new FilterSequenceStringBuffer().append(filters).toString();%0A%09%09%7D%0A%09%7D
 %0A%0A%09p
@@ -1169,18 +1169,19 @@
 StringBu
-ff
+ild
 er buffe
@@ -1192,26 +1192,27 @@
 new StringBu
-ff
+ild
 er();%0A%09%09buff

Add Serializer to AggregateFilter Use StringBuffer instead of StringBuilder