// Path: src/main/java/de/skuzzle/enforcer/restrictimports/util/StringRepresentation.java
// public final class StringRepresentation {
// 
//     private final String name;
//     private final List<Attribute> attributes = new ArrayList<>();
// 
//     private StringRepresentation(String name) {
//         this.name = name;
//     }
// 
//     public static StringRepresentation ofType(Class<?> type) {
//         return new StringRepresentation(type.getSimpleName());
//     }
// 
//     public static StringRepresentation ofInstance(Object instance) {
//         return ofType(instance.getClass());
//     }
// 
//     public StringRepresentation add(String attribute, Object value) {
//         attributes.add(new Attribute(attribute, value));
//         return this;
//     }
// 
//     @Override
//     public String toString() {
//         return new StringBuilder(name)
//                 .append("{")
//                 .append(attributes.stream().map(Attribute::toString).collect(Collectors.joining(", ")))
//                 .append("}")
//                 .toString();
//     }
// 
//     private static final class Attribute {
//         private final String name;
//         private final Object value;
// 
//         private Attribute(String name, Object value) {
//             this.name = name;
//             this.value = value;
//         }
// 
//         @Override
//         public String toString() {
//             return name + "=" + value;
//         }
//     }
// }


import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import de.skuzzle.enforcer.restrictimports.util.StringRepresentation;
    @Override
    public int hashCode() {
        return Objects.hash(basePackages, bannedImports, allowedImports, exclusions, reason);
    }

    @Override
    public boolean equals(Object obj) {
        return obj == this || obj instanceof BannedImportGroup
                && Objects.equals(basePackages, ((BannedImportGroup) obj).basePackages)
                && Objects.equals(bannedImports, ((BannedImportGroup) obj).bannedImports)
                && Objects.equals(allowedImports, ((BannedImportGroup) obj).allowedImports)
                && Objects.equals(exclusions, ((BannedImportGroup) obj).exclusions)
                && Objects.equals(reason, ((BannedImportGroup) obj).reason);
    }

    @Override
    public String toString() {
        return StringRepresentation.ofInstance(this)
                .add("basePackages", this.basePackages)
                .add("bannedImports", this.bannedImports)
                .add("allowedImports", this.allowedImports)
                .add("exclusions", this.exclusions)
                .add("reason", this.reason)
                .toString();
    }

    public static class Builder {
        private List<PackagePattern> basePackages = Collections.emptyList();
        private List<PackagePattern> bannedImports = Collections.emptyList();
        private List<PackagePattern> allowedImports = Collections.emptyList();
// Path: src/main/java/de/skuzzle/enforcer/restrictimports/util/StringRepresentation.java
// public final class StringRepresentation {
// 
//     private final String name;
//     private final List<Attribute> attributes = new ArrayList<>();
// 
//     private StringRepresentation(String name) {
//         this.name = name;
//     }
// 
//     public static StringRepresentation ofType(Class<?> type) {
//         return new StringRepresentation(type.getSimpleName());
//     }
// 
//     public static StringRepresentation ofInstance(Object instance) {
//         return ofType(instance.getClass());
//     }
// 
//     public StringRepresentation add(String attribute, Object value) {
//         attributes.add(new Attribute(attribute, value));
//         return this;
//     }
// 
//     @Override
//     public String toString() {
//         return new StringBuilder(name)
//                 .append("{")
//                 .append(attributes.stream().map(Attribute::toString).collect(Collectors.joining(", ")))
//                 .append("}")
//                 .toString();
//     }
// 
//     private static final class Attribute {
//         private final String name;
//         private final Object value;
// 
//         private Attribute(String name, Object value) {
//             this.name = name;
//             this.value = value;
//         }
// 
//         @Override
//         public String toString() {
//             return name + "=" + value;
//         }
//     }
// }


// Path: src/main/java/de/skuzzle/enforcer/restrictimports/analyze/BannedImportGroup.java
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import de.skuzzle.enforcer.restrictimports.util.StringRepresentation;

    @Override
    public int hashCode() {
        return Objects.hash(basePackages, bannedImports, allowedImports, exclusions, reason);
    }

    @Override
    public boolean equals(Object obj) {
        return obj == this || obj instanceof BannedImportGroup
                && Objects.equals(basePackages, ((BannedImportGroup) obj).basePackages)
                && Objects.equals(bannedImports, ((BannedImportGroup) obj).bannedImports)
                && Objects.equals(allowedImports, ((BannedImportGroup) obj).allowedImports)
                && Objects.equals(exclusions, ((BannedImportGroup) obj).exclusions)
                && Objects.equals(reason, ((BannedImportGroup) obj).reason);
    }

    @Override
    public String toString() {
        return StringRepresentation.ofInstance(this)
                .add("basePackages", this.basePackages)
                .add("bannedImports", this.bannedImports)
                .add("allowedImports", this.allowedImports)
                .add("exclusions", this.exclusions)
                .add("reason", this.reason)
                .toString();
    }

    public static class Builder {
        private List<PackagePattern> basePackages = Collections.emptyList();
        private List<PackagePattern> bannedImports = Collections.emptyList();
        private List<PackagePattern> allowedImports = Collections.emptyList();
        private List<PackagePattern> exclusions = Collections.emptyList();