### Question:
UpdateZoomLevelRoutine { public void updateZoomLevel(@FloatRange(from = 0f, to = 1f) float zoomLevel) { ensureInBounds(zoomLevel); if (cameraDevice.getCapabilities().isZoomSupported()) { cameraDevice.setZoom(zoomLevel); } } UpdateZoomLevelRoutine(CameraDevice cameraDevice); void updateZoomLevel(@FloatRange(from = 0f, to = 1f) float zoomLevel);  }### Answer:
@SuppressWarnings("Range") @Test(expected = LevelOutOfRangeException.class) public void outOfRange_Higher() throws Exception { testee.updateZoomLevel(1.1f); }
@SuppressWarnings("Range") @Test(expected = LevelOutOfRangeException.class) public void outOfRange_Lower() throws Exception { testee.updateZoomLevel(-0.1f); }
@Test public void updateZoomLevel() throws Exception { givenZoomSupported(); testee.updateZoomLevel(0.5f); verify(cameraDevice).setZoom(0.5f); }
@Test public void zoomNotSupported() throws Exception { givenZoomNotSupported(); testee.updateZoomLevel(0.5f); verify(cameraDevice, never()).setZoom(anyFloat()); }