@@ -0,0 +1,1664 @@
+package sword.langbook3.android.util;%0A%0Apublic final class PreconditionUtils %7B%0A%0A    /**%0A     * Ensure that some preconditions are met, or throw an IllegalArgumentException if not.%0A     * %3Cp%3E%0A     * This method is expected to be used at the beginning of a method in order to ensure that the%0A     * given arguments matches some assumed preconditions.%0A     *%0A     * This is especially valuable in constructors or setters where some arguments are going to be%0A     * stored to be used later in order to find any possible error as soon as possible.%0A     *%0A     * This method should never be used to check user entered, or server entered data, as it cannot%0A     * be considered a development error, and a proper feedback should be provided to the user%0A     * instead of crashing.%0A     *%0A     * @param condition If true, nothing happens.%0A     *                  If false, the app will crash to prevent propagating the error.%0A     */%0A    public static void ensureValidArguments(boolean condition) %7B%0A        if (!condition) %7B%0A            throw new IllegalArgumentException();%0A        %7D%0A    %7D%0A%0A    /**%0A     * Ensure that all references provided as parameters are different from null.%0A     * %3Cp%3E%0A     * If all references are different from null, nothing will happen.%0A     * If any of the references is null, an IllegalArgumentException will be thrown.%0A     *%0A     * @param references References to be checked.%0A     */%0A    public static void ensureNonNull(Object... references) %7B%0A        for (Object ref : references) %7B%0A            if (ref == null) %7B%0A                throw new IllegalArgumentException();%0A            %7D%0A        %7D%0A    %7D%0A%0A    private PreconditionUtils() %7B%0A    %7D%0A%7D%0A

Include PreconditionUtils in the dbManager module