private static void check(StateAccessingThread[] threads, boolean postInit) {

        int[] stateCount = getStateCount(threads);
        printStateCount(stateCount);

        if (stateCount[UNINITIALIZED_STATE] != 0) {
            throw new IllegalStateException("getState() should never return a zero value");
        }

        if (stateCount[SUCCESS] != 0 && stateCount[FAILURE] != 0) {
            throw new IllegalStateException("getState() should return consistent values");
        }

        if (postInit) {
            if (stateCount[SUCCESS] != THREAD_COUNT && stateCount[FAILURE] != THREAD_COUNT) {
                throw new IllegalStateException("getState() should return consistent values");
            }
        }

    }
This class demonstrates that threads accessing the STATE variable always see a consistent value. 

During ongoing initialization the observed value is either ONGOING_INITIALIZATION
or one of {SUCCESS, FAILURE}. 

Post initialization the observed value is always one of  {SUCCESS, FAILURE}.

See also http://jira.qos.ch/browse/SLF4J-167 

@author ceki
slf4j-api/src/test/java/org/slf4j/basicTests/DoubleCheckedInt.java