// Path: src/main/java/de/skuzzle/enforcer/restrictimports/util/Preconditions.java
// public final class Preconditions {
// 
//     public static void checkArgument(boolean condition) {
//         checkArgument(condition, "Unexpected argument");
//     }
// 
//     public static void checkArgument(boolean condition, String message, Object... args) {
//         if (!condition) {
//             throw new IllegalArgumentException(String.format(message, args));
//         }
//     }
// 
//     public static void checkState(boolean condition) {
//         checkState(condition, "Unexpected state");
//     }
// 
//     public static void checkState(boolean condition, String message, Object... args) {
//         if (!condition) {
//             throw new IllegalStateException(String.format(message, args));
//         }
//     }
// 
//     private Preconditions() {
//         throw new IllegalStateException("hidden");
//     }
// }


import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import de.skuzzle.enforcer.restrictimports.util.Preconditions;

        public GroupMatch(PackagePattern basePackage, BannedImportGroup group) {
            this.basePackage = basePackage;
            this.group = group;
        }

        public BannedImportGroup getGroup() {
            return this.group;
        }

        @Override
        public int compareTo(GroupMatch o) {
            return o.basePackage.compareTo(basePackage);
        }
    }

    public static final class Builder {
        private final List<BannedImportGroup> groups = new ArrayList<>();

        public Builder withGroups(Collection<BannedImportGroup> groups) {
            this.groups.addAll(groups);
            return this;
        }

        public Builder withGroup(BannedImportGroup group) {
            this.groups.add(group);
            return this;
        }

        public Builder withGroup(BannedImportGroup.Builder groupBuilder) {
// Path: src/main/java/de/skuzzle/enforcer/restrictimports/util/Preconditions.java
// public final class Preconditions {
// 
//     public static void checkArgument(boolean condition) {
//         checkArgument(condition, "Unexpected argument");
//     }
// 
//     public static void checkArgument(boolean condition, String message, Object... args) {
//         if (!condition) {
//             throw new IllegalArgumentException(String.format(message, args));
//         }
//     }
// 
//     public static void checkState(boolean condition) {
//         checkState(condition, "Unexpected state");
//     }
// 
//     public static void checkState(boolean condition, String message, Object... args) {
//         if (!condition) {
//             throw new IllegalStateException(String.format(message, args));
//         }
//     }
// 
//     private Preconditions() {
//         throw new IllegalStateException("hidden");
//     }
// }


// Path: src/main/java/de/skuzzle/enforcer/restrictimports/analyze/BannedImportGroups.java
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import de.skuzzle.enforcer.restrictimports.util.Preconditions;


        public GroupMatch(PackagePattern basePackage, BannedImportGroup group) {
            this.basePackage = basePackage;
            this.group = group;
        }

        public BannedImportGroup getGroup() {
            return this.group;
        }

        @Override
        public int compareTo(GroupMatch o) {
            return o.basePackage.compareTo(basePackage);
        }
    }

    public static final class Builder {
        private final List<BannedImportGroup> groups = new ArrayList<>();

        public Builder withGroups(Collection<BannedImportGroup> groups) {
            this.groups.addAll(groups);
            return this;
        }

        public Builder withGroup(BannedImportGroup group) {
            this.groups.add(group);
            return this;
        }

        public Builder withGroup(BannedImportGroup.Builder groupBuilder) {
            groups.add(groupBuilder.build());