@@ -0,0 +1,708 @@
+package de.akquinet.jbosscc.needle.common;%0A%0Aimport static de.akquinet.jbosscc.needle.common.Preconditions.checkState;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException;%0A%0Apublic class PreconditionsTest %7B%0A%0A    @Rule%0A    public final ExpectedException thrown = ExpectedException.none();%0A%0A    @Test%0A    public void shouldThrowIllegalStateException() %7B%0A        thrown.expect(IllegalStateException.class);%0A        thrown.expectMessage(%22failed with param=foo%22);%0A%0A        checkState(false, %22failed with param=%25s%22, %22foo%22);%0A    %7D%0A%0A    @Test%0A    public void shouldPassWithoutException() %7B%0A        checkState(true, %22should pass%22);%0A        // success if no exception thrown%0A    %7D%0A%0A%7D%0A

test for checkState