    @Test
    public void testNetworkStateNotConnected() {

        NetworkInfo networkInfo = mock(NetworkInfo.class);
        when(networkInfo.isConnected()).thenReturn(false);
        when(networkInfo.isConnectedOrConnecting()).thenReturn(false);

        ConnectivityManager connectivityManager = mock(ConnectivityManager.class);
        when(connectivityManager.getActiveNetworkInfo()).thenReturn(networkInfo);

        Context context = mock(MockContext.class);
        when(context.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(connectivityManager);

        assertThat(Device.getNetworkType(context)).isEqualTo(JobRequest.NetworkType.ANY);
    }