// Path: src/main/java/be/fror/common/base/Preconditions.java
// public static <T> T checkArgument(@Nullable T value, Predicate<? super T> predicate) {
//   if (predicate.test(value)) {
//     return value;
//   } else {
//     throw new IllegalArgumentException();
//   }
// }
// 
// Path: src/main/java/be/fror/common/base/Preconditions.java
// public static <T> T checkNotNull(@Nullable T reference) {
//   if (reference != null) {
//     return reference;
//   } else {
//     throw new NullPointerException();
//   }
// }
// 
// Path: src/main/java/be/fror/common/base/Preconditions.java
// public static void checkState(boolean expression) {
//   if (!expression) {
//     throw new IllegalStateException();
//   }
// }
// 
// Path: src/main/java/be/fror/common/base/Throwables.java
// public static RuntimeException propagate(Throwable throwable) {
//   propagateIfPossible(checkNotNull(throwable));
//   throw new RuntimeException(throwable);
// }
// 
// Path: src/main/java/be/fror/common/io/Resources.java
// public static ByteSource asByteSource(URL url) {
//   return new UrlByteSource(checkNotNull(url));
// }
// 
// Path: src/main/java/be/fror/common/io/Resources.java
// public static CharSource asCharSource(URL url, Charset charset) {
//   return asByteSource(url)
//       .asCharSource(charset);
// }


import static be.fror.common.base.Preconditions.checkArgument;
import static be.fror.common.base.Preconditions.checkNotNull;
import static be.fror.common.base.Preconditions.checkState;
import static be.fror.common.base.Throwables.propagate;
import static be.fror.common.io.Resources.asByteSource;
import static be.fror.common.io.Resources.asCharSource;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.Files.isDirectory;
import static java.util.Arrays.asList;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toList;
import com.google.common.base.CharMatcher;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.reflect.ClassPath;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.FileSystem;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.function.Predicate;
import java.util.jar.JarFile;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.concurrent.ThreadSafe;
        classLoaders.add(new URLClassLoader(new URL[]{url}, null));
      } catch (IOException unused) {
        checkArgument(false, "jarSource doesn't refer to a valid jar file");
      }
      return this;
    }

    /**
     *
     * @param directorySource
     * @return
     * @throws IllegalArgumentException
     */
    public Builder addDirectory(Path directorySource) {
      checkNotNull(directorySource);
      checkArgument(isDirectory(directorySource), "directorySource is not a directory");
      try {
        classLoaders.add(new URLClassLoader(new URL[]{directorySource.toUri().toURL()}, null));
      } catch (IOException unused) {
        checkArgument(false, "directorySource cannot be mapped to a URL");
      }
      return this;
    }

    /**
     *
     * @return @throws IOException
     * @throws IllegalStateException
     */
    public ResourceLocator build() throws IOException {
// Path: src/main/java/be/fror/common/base/Preconditions.java
// public static <T> T checkArgument(@Nullable T value, Predicate<? super T> predicate) {
//   if (predicate.test(value)) {
//     return value;
//   } else {
//     throw new IllegalArgumentException();
//   }
// }
// 
// Path: src/main/java/be/fror/common/base/Preconditions.java
// public static <T> T checkNotNull(@Nullable T reference) {
//   if (reference != null) {
//     return reference;
//   } else {
//     throw new NullPointerException();
//   }
// }
// 
// Path: src/main/java/be/fror/common/base/Preconditions.java
// public static void checkState(boolean expression) {
//   if (!expression) {
//     throw new IllegalStateException();
//   }
// }
// 
// Path: src/main/java/be/fror/common/base/Throwables.java
// public static RuntimeException propagate(Throwable throwable) {
//   propagateIfPossible(checkNotNull(throwable));
//   throw new RuntimeException(throwable);
// }
// 
// Path: src/main/java/be/fror/common/io/Resources.java
// public static ByteSource asByteSource(URL url) {
//   return new UrlByteSource(checkNotNull(url));
// }
// 
// Path: src/main/java/be/fror/common/io/Resources.java
// public static CharSource asCharSource(URL url, Charset charset) {
//   return asByteSource(url)
//       .asCharSource(charset);
// }


// Path: src/main/java/be/fror/common/resource/ResourceLocator.java
import static be.fror.common.base.Preconditions.checkArgument;
import static be.fror.common.base.Preconditions.checkNotNull;
import static be.fror.common.base.Preconditions.checkState;
import static be.fror.common.base.Throwables.propagate;
import static be.fror.common.io.Resources.asByteSource;
import static be.fror.common.io.Resources.asCharSource;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.Files.isDirectory;
import static java.util.Arrays.asList;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toList;
import com.google.common.base.CharMatcher;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.reflect.ClassPath;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.FileSystem;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.function.Predicate;
import java.util.jar.JarFile;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.concurrent.ThreadSafe;

        classLoaders.add(new URLClassLoader(new URL[]{url}, null));
      } catch (IOException unused) {
        checkArgument(false, "jarSource doesn't refer to a valid jar file");
      }
      return this;
    }

    /**
     *
     * @param directorySource
     * @return
     * @throws IllegalArgumentException
     */
    public Builder addDirectory(Path directorySource) {
      checkNotNull(directorySource);
      checkArgument(isDirectory(directorySource), "directorySource is not a directory");
      try {
        classLoaders.add(new URLClassLoader(new URL[]{directorySource.toUri().toURL()}, null));
      } catch (IOException unused) {
        checkArgument(false, "directorySource cannot be mapped to a URL");
      }
      return this;
    }

    /**
     *
     * @return @throws IOException
     * @throws IllegalStateException
     */
    public ResourceLocator build() throws IOException {
      checkState(!classLoaders.isEmpty(), "At least one source must be added");