    @Test
    public void testCalculateStatusNetworkState() {

        PowerMockito.mockStatic(SP.class);
        // wifiOnly = false
        // allowRoaming = false as well
        when(SP.getBoolean(anyInt(), anyBoolean())).thenReturn(false);
        when(SP.getString(anyInt(), anyString())).thenReturn("");
        EventNetworkChange ev = new EventNetworkChange();
        ev.setSsid("<unknown ssid>");

        ev.setMobileConnected(true);
        ev.setWifiConnected(true);
        assertTrue(sut.calculateStatus(ev));

        ev.setSsid("test");
        when(SP.getString(anyInt(), anyString())).thenReturn("\"test\"");
        assertTrue(sut.calculateStatus(ev));

        ev.setSsid("\"test\"");
        assertTrue(sut.calculateStatus(ev));
        
        ev.setWifiConnected(false);
        assertTrue(sut.calculateStatus(ev));

        // wifiOnly = true
        // allowRoaming = true as well
        when(SP.getBoolean(anyInt(), anyBoolean())).thenReturn(true);
        ev.setWifiConnected(true);
        assertTrue(sut.calculateStatus(ev));
        ev.setWifiConnected(false);
        assertTrue(!sut.calculateStatus(ev));

        // wifiOnly = false
        // allowRoaming = false as well
        when(SP.getBoolean(anyInt(), anyBoolean())).thenReturn(false);
        ev.setWifiConnected(false);
        ev.setRoaming(true);
        assertTrue(!sut.calculateStatus(ev));

        // wifiOnly = false
        // allowRoaming = true
        when(SP.getBoolean(R.string.key_ns_wifionly, false)).thenReturn(false);
        when(SP.getBoolean(R.string.key_ns_allowroaming, true)).thenReturn(true);
        ev.setWifiConnected(false);
        ev.setRoaming(true);
        assertTrue(sut.calculateStatus(ev));

        // wifiOnly = true
        // allowRoaming = true
        when(SP.getBoolean(R.string.key_ns_wifionly, false)).thenReturn(true);
        when(SP.getBoolean(R.string.key_ns_allowroaming, true)).thenReturn(true);
        ev.setWifiConnected(false);
        ev.setRoaming(true);
        assertTrue(!sut.calculateStatus(ev));

        // wifiOnly = true
        // allowRoaming = true
        when(SP.getBoolean(R.string.key_ns_wifionly, false)).thenReturn(true);
        when(SP.getBoolean(R.string.key_ns_allowroaming, true)).thenReturn(true);
        ev.setWifiConnected(true);
        ev.setRoaming(true);
        assertTrue(sut.calculateStatus(ev));

        // wifiOnly = false
        // allowRoaming = false
        when(SP.getBoolean(R.string.key_ns_wifionly, false)).thenReturn(false);
        when(SP.getBoolean(R.string.key_ns_allowroaming, true)).thenReturn(false);
        ev.setWifiConnected(true);
        ev.setRoaming(true);
        assertTrue(sut.calculateStatus(ev));
    }