@Test public void retrieveNullIfNotCamera2CameraCaptureResult() { CameraCaptureResult cameraCaptureResult = new CameraCaptureResult.EmptyCameraCaptureResult(); CaptureResult captureResult = Camera2CameraCaptureResultConverter.getCaptureResult( cameraCaptureResult); assertThat(captureResult).isNull(); }
public static CaptureResult getCaptureResult(CameraCaptureResult cameraCaptureResult) { if (cameraCaptureResult instanceof Camera2CameraCaptureResult) { return ((Camera2CameraCaptureResult) cameraCaptureResult).getCaptureResult(); } else { return null; } }
Camera2CameraCaptureResultConverter { public static CaptureResult getCaptureResult(CameraCaptureResult cameraCaptureResult) { if (cameraCaptureResult instanceof Camera2CameraCaptureResult) { return ((Camera2CameraCaptureResult) cameraCaptureResult).getCaptureResult(); } else { return null; } } }
Camera2CameraCaptureResultConverter { public static CaptureResult getCaptureResult(CameraCaptureResult cameraCaptureResult) { if (cameraCaptureResult instanceof Camera2CameraCaptureResult) { return ((Camera2CameraCaptureResult) cameraCaptureResult).getCaptureResult(); } else { return null; } } private  Camera2CameraCaptureResultConverter(); }
Camera2CameraCaptureResultConverter { public static CaptureResult getCaptureResult(CameraCaptureResult cameraCaptureResult) { if (cameraCaptureResult instanceof Camera2CameraCaptureResult) { return ((Camera2CameraCaptureResult) cameraCaptureResult).getCaptureResult(); } else { return null; } } private  Camera2CameraCaptureResultConverter(); static CaptureResult getCaptureResult(CameraCaptureResult cameraCaptureResult); }
Camera2CameraCaptureResultConverter { public static CaptureResult getCaptureResult(CameraCaptureResult cameraCaptureResult) { if (cameraCaptureResult instanceof Camera2CameraCaptureResult) { return ((Camera2CameraCaptureResult) cameraCaptureResult).getCaptureResult(); } else { return null; } } private  Camera2CameraCaptureResultConverter(); static CaptureResult getCaptureResult(CameraCaptureResult cameraCaptureResult);  }