package de.akquinet.jbosscc.needle.common;

import static java.lang.String.format;

/**
 * Utility class for checks and verifications. Inspired by guava/Preconditions, but without adding the external
 * dependency.
 * 
 * @author Jan Galinski, Holisticon AG
 */
public final class Preconditions {

    private Preconditions() {
        // avoid instantiation.
    }

    public static void checkState(final boolean expression, final String message, final Object... parameters) {
        if (!expression) {
            throw new IllegalStateException(format(message, parameters));
        }
    }
}

@@ -160,16 +160,19 @@
 ditions,
+%0A *
  but wit
@@ -195,19 +195,16 @@
 external
-%0A *
  depende
@@ -368,59 +368,1152 @@
     
-public static void checkState(final boolean express
+/**%0A     * Throws an %7B@link IllegalStateException%7D with formatted message if%0A     * condition is not met.%0A     * %0A     * @param condition%0A     *            a boolean condition that must be %3Ccode%3Etrue%3C/code%3E to pass%0A     * @param message%0A     *            text to use as exception message%0A     * @param parameters%0A     *            optional paramaters used in%0A     *            %7B@link String#format(String, Object...)%7D%0A     */%0A    public static void checkState(final boolean condition, final String message, final Object... parameters) %7B%0A        if (!condition) %7B%0A            throw new IllegalStateException(format(message, parameters));%0A        %7D%0A    %7D%0A%0A    /**%0A     * Throws an %7B@link IllegalArgumentException%7D with formatted message if%0A     * condition is not met.%0A     * %0A     * @param condition%0A     *            a boolean condition that must be %3Ccode%3Etrue%3C/code%3E to pass%0A     * @param message%0A     *            text to use as exception message%0A     * @param parameters%0A     *            optional paramaters used in%0A     *            %7B@link String#format(String, Object...)%0A%0A     */%0A    public static void checkArgument(final boolean condit
 ion,
@@ -1582,15 +1582,14 @@
 f (!
-express
+condit
 ion)
@@ -1612,37 +1612,40 @@
 hrow new Illegal
-State
+Argument
 Exception(format

add checkArgument