### Question:
SystemJobInfoConverter { static int convertNetworkType(NetworkType networkType) { switch(networkType) { case NOT_REQUIRED: return JobInfo.NETWORK_TYPE_NONE; case CONNECTED: return JobInfo.NETWORK_TYPE_ANY; case UNMETERED: return JobInfo.NETWORK_TYPE_UNMETERED; case NOT_ROAMING: if (Build.VERSION.SDK_INT >= 24) { return JobInfo.NETWORK_TYPE_NOT_ROAMING; } break; case METERED: if (Build.VERSION.SDK_INT >= 26) { return JobInfo.NETWORK_TYPE_METERED; } break; } Log.d(TAG, String.format( "API version too low. Cannot convert network type value %s", networkType)); return JobInfo.NETWORK_TYPE_ANY; } @VisibleForTesting(otherwise = PACKAGE_PRIVATE)  SystemJobInfoConverter(@NonNull Context context);   }### Answer:
@Test @SmallTest public void testConvertNetworkType_none() { assertThat(SystemJobInfoConverter.convertNetworkType(NOT_REQUIRED), is(JobInfo.NETWORK_TYPE_NONE)); }
@Test @SmallTest public void testConvertNetworkType_any() { assertThat(SystemJobInfoConverter.convertNetworkType(CONNECTED), is(JobInfo.NETWORK_TYPE_ANY)); }
@Test @SmallTest public void testConvertNetworkType_unmetered() { assertThat(SystemJobInfoConverter.convertNetworkType(UNMETERED), is(JobInfo.NETWORK_TYPE_UNMETERED)); }
@Test @SmallTest @SdkSuppress(minSdkVersion = 23, maxSdkVersion = 23) public void testConvertNetworkType_notRoaming_returnAnyBeforeApi24() { assertThat(SystemJobInfoConverter.convertNetworkType(NOT_ROAMING), is(JobInfo.NETWORK_TYPE_ANY)); }
@Test @SmallTest @SdkSuppress(minSdkVersion = 24) public void testConvertNetworkType_notRoaming_returnsNotRoamingAtOrAfterApi24() { assertThat(SystemJobInfoConverter.convertNetworkType(NOT_ROAMING), is(JobInfo.NETWORK_TYPE_NOT_ROAMING)); }
@Test @SmallTest @SdkSuppress(minSdkVersion = WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL, maxSdkVersion = 25) public void testConvertNetworkType_metered_returnsAnyBeforeApi26() { assertThat(SystemJobInfoConverter.convertNetworkType(METERED), is(JobInfo.NETWORK_TYPE_ANY)); }
@Test @SmallTest @SdkSuppress(minSdkVersion = 26) public void testConvertNetworkType_metered_returnsMeteredAtOrAfterApi26() { assertThat(SystemJobInfoConverter.convertNetworkType(METERED), is(JobInfo.NETWORK_TYPE_METERED)); }