// 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/util/Whitespaces.java
// public final class Whitespaces {
// 
//     private static final Pattern LEADING = Pattern.compile("^\\s+");
//     private static final Pattern TRAILING = Pattern.compile("\\s+$");
// 
//     /**
//      * Trims all leading and trailing whitespaces (regex pattern class <code>\s</code>)
//      *
//      * @param s The string to trim.
//      * @return The trimmed string.
//      */
//     public static final String trimAll(String s) {
//         final Matcher leadingMatcher = LEADING.matcher(s);
//         final Matcher trailingMatcher = TRAILING.matcher(s);
//         final boolean hasLeading = leadingMatcher.find();
//         final boolean hasTrailing = trailingMatcher.find();
//         if (!hasLeading && !hasTrailing) {
//             return s;
//         }
//         final int start = hasLeading ? leadingMatcher.end() : 0;
//         final int end = hasTrailing ? trailingMatcher.start() : s.length();
//         return s.substring(start, end);
//     }
// 
//     private Whitespaces() {
//         // hidden
//     }
// }


import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import de.skuzzle.enforcer.restrictimports.util.Preconditions;
import de.skuzzle.enforcer.restrictimports.util.Whitespaces;
            return;
        } else if (part.contains("*")) {
            throw new IllegalArgumentException(String.format(
                    "The pattern '%s' contains a part which mixes wildcards and normal characters", original));
        } else if (partIndex == 0 && "static".equals(part)) {
            return;
        } else if (!Character.isJavaIdentifierStart(chars[0])) {
            throw new IllegalArgumentException(String.format(
                    "The pattern '%s' contains a non-identifier character '%s' (0x%s)", original, chars[0],
                    Integer.toHexString(chars[0])));
        }

        for (int i = 1; i < chars.length; i++) {
            final char c = chars[i];
            if (!Character.isJavaIdentifierPart(c)) {
                throw new IllegalArgumentException(String.format(
                        "The pattern '%s' contains a non-identifier character '%s' (0x%s)", original, chars[i],
                        Integer.toHexString(chars[i])));
            }
        }
    }

    /**
     * Parses each string of the given collection into a {@link PackagePattern} and
     * returns them in a list.
     *
     * @param patternStrings The Strings to parse.
     * @return A list of parsed package patterns.
     */
    public static List<PackagePattern> parseAll(Collection<String> patternStrings) {
// 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/util/Whitespaces.java
// public final class Whitespaces {
// 
//     private static final Pattern LEADING = Pattern.compile("^\\s+");
//     private static final Pattern TRAILING = Pattern.compile("\\s+$");
// 
//     /**
//      * Trims all leading and trailing whitespaces (regex pattern class <code>\s</code>)
//      *
//      * @param s The string to trim.
//      * @return The trimmed string.
//      */
//     public static final String trimAll(String s) {
//         final Matcher leadingMatcher = LEADING.matcher(s);
//         final Matcher trailingMatcher = TRAILING.matcher(s);
//         final boolean hasLeading = leadingMatcher.find();
//         final boolean hasTrailing = trailingMatcher.find();
//         if (!hasLeading && !hasTrailing) {
//             return s;
//         }
//         final int start = hasLeading ? leadingMatcher.end() : 0;
//         final int end = hasTrailing ? trailingMatcher.start() : s.length();
//         return s.substring(start, end);
//     }
// 
//     private Whitespaces() {
//         // hidden
//     }
// }


// Path: src/main/java/de/skuzzle/enforcer/restrictimports/analyze/PackagePattern.java
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import de.skuzzle.enforcer.restrictimports.util.Preconditions;
import de.skuzzle.enforcer.restrictimports.util.Whitespaces;

            return;
        } else if (part.contains("*")) {
            throw new IllegalArgumentException(String.format(
                    "The pattern '%s' contains a part which mixes wildcards and normal characters", original));
        } else if (partIndex == 0 && "static".equals(part)) {
            return;
        } else if (!Character.isJavaIdentifierStart(chars[0])) {
            throw new IllegalArgumentException(String.format(
                    "The pattern '%s' contains a non-identifier character '%s' (0x%s)", original, chars[0],
                    Integer.toHexString(chars[0])));
        }

        for (int i = 1; i < chars.length; i++) {
            final char c = chars[i];
            if (!Character.isJavaIdentifierPart(c)) {
                throw new IllegalArgumentException(String.format(
                        "The pattern '%s' contains a non-identifier character '%s' (0x%s)", original, chars[i],
                        Integer.toHexString(chars[i])));
            }
        }
    }

    /**
     * Parses each string of the given collection into a {@link PackagePattern} and
     * returns them in a list.
     *
     * @param patternStrings The Strings to parse.
     * @return A list of parsed package patterns.
     */
    public static List<PackagePattern> parseAll(Collection<String> patternStrings) {
        Preconditions.checkArgument(patternStrings != null);