class ShowMessageLogic {

    public boolean shouldShowMessage() {
        return counterPreferences.getCounter() >= 42;
    }

}

class ShowMessageLogicTest {

    private final SPMockBuilder spMockBuilder;
    private CounterPreferences counterPreferences;
    private ShowMessageLogic showMessageLogic;

    @Test
    public void on42CounterItShouldShowMessage() {

        counterPreferences.setCounter(42);

        Assert.assertTrue(showMessageLogic.shouldShowMessage());
    }

}