CameraParametersHelper { static boolean isFocusModeSupported(@NonNull String focusMode, @NonNull Camera camera) { return camera.getParameters().getSupportedFocusModes().contains(focusMode); } private  CameraParametersHelper();   }
@Test public void should_verifyThatFocusMode_isSupported() { when(mParameters.getSupportedFocusModes()).thenReturn( Arrays.asList(Camera.Parameters.FOCUS_MODE_AUTO, Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)); boolean isSupported = CameraParametersHelper.isFocusModeSupported( Camera.Parameters.FOCUS_MODE_AUTO, mCamera); assertThat(isSupported).isTrue(); }
@Test public void should_verifyThatFocusMode_isNotSupported() { when(mParameters.getSupportedFocusModes()).thenReturn( Collections.singletonList(Camera.Parameters.FOCUS_MODE_AUTO)); boolean isSupported = CameraParametersHelper.isFocusModeSupported( Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE, mCamera); assertThat(isSupported).isFalse(); }