@Test
    public void testANonNullOfWithNullPrimitiveTypes() {
        // The last error reported
        ExpectationError lastError = null;

        Story story = Story.create(new Scenario() {
            {
                expect(joe).setBoolean_(aNonNullOf(boolean.class));
                expect(joe).setChar_(aNonNullOf(char.class));
                expect(joe).setByte_(aNonNullOf(byte.class));
                expect(joe).setShort_(aNonNullOf(short.class));
                expect(joe).setInt_(aNonNullOf(int.class));
                expect(joe).setLong_(aNonNullOf(long.class));
                expect(joe).setFloat_(aNonNullOf(float.class));
                expect(joe).setDouble_(aNonNullOf(double.class));
            }
        });

        story.begin();
        try {
            joe.setBoolean_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);

        story.begin();
        joe.setBoolean_(true);
        try {
            joe.setChar_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);

        story.begin();
        joe.setBoolean_(true);
        joe.setChar_('W');
        try {
            joe.setByte_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);

        story.begin();
        joe.setBoolean_(true);
        joe.setChar_('W');
        joe.setByte_((byte) 154);
        try {
            joe.setShort_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);

        story.begin();
        joe.setBoolean_(true);
        joe.setChar_('W');
        joe.setByte_((byte) 154);
        joe.setShort_((short) 154);
        try {
            joe.setInt_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);

        story.begin();
        joe.setBoolean_(true);
        joe.setChar_('W');
        joe.setByte_((byte) 154);
        joe.setShort_((short) 154);
        joe.setInt_(154);
        try {
            joe.setLong_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);

        story.begin();
        joe.setBoolean_(true);
        joe.setChar_('W');
        joe.setByte_((byte) 154);
        joe.setShort_((short) 154);
        joe.setInt_(154);
        joe.setLong_((long) 154);
        try {
            joe.setFloat_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);

        story.begin();
        joe.setBoolean_(true);
        joe.setChar_('W');
        joe.setByte_((byte) 154);
        joe.setShort_((short) 154);
        joe.setInt_(154);
        joe.setLong_((long) 154);
        joe.setFloat_((float) 154.0);
        try {
            joe.setDouble_(null);
            fail("set null to aNonNullOf clause");
        } catch (UnexpectedInvocationError e) {
            lastError = e;
        }
        assertEndReportsError(story, lastError);
    }