CameraCaptureResults { public static CameraCaptureResult retrieveCameraCaptureResult(ImageInfo imageInfo) { if (imageInfo instanceof CameraCaptureResultImageInfo) { return ((CameraCaptureResultImageInfo) imageInfo).getCameraCaptureResult(); } else { return null; } } private  CameraCaptureResults(); static CameraCaptureResult retrieveCameraCaptureResult(ImageInfo imageInfo);  }
@Test public void canRetrieveCameraCaptureResult() { ImageInfo imageInfo = new CameraCaptureResultImageInfo(mCameraCaptureResult); CameraCaptureResult cameraCaptureResult = CameraCaptureResults.retrieveCameraCaptureResult( imageInfo); assertThat(cameraCaptureResult).isSameInstanceAs(mCameraCaptureResult); }
@Test public void retrieveNullIfNotCameraCaptureResultImageInfo() { ImageInfo imageInfo = new FakeImageInfo(); CameraCaptureResult cameraCaptureResult = CameraCaptureResults.retrieveCameraCaptureResult( imageInfo); assertThat(cameraCaptureResult).isNull(); }