private static void printStateCount(int[] stateCount) {
        for (int i = 0; i < NUMBER_OF_STATES; i++) {
            switch (i) {
            case UNINITIALIZED_STATE:
                System.out.println("UNINITIALIZED_STATE count: " + stateCount[i]);
                break;
            case ONGOING_INITIALIZATION:
                System.out.println("ONGOING_INITIALIZATION count: " + stateCount[i]);
                break;
            case SUCCESS:
                System.out.println("SUCCESS count: " + stateCount[i]);
                break;
            case FAILURE:
                System.out.println("FAILURE count: " + stateCount[i]);
                break;
            }
        }
    }
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