@Test public void toCaptureCallback_withCaptureCallbackContainer() { CaptureCallback actualCallback = Mockito.mock(CaptureCallback.class); CaptureCallbackContainer callbackContainer = CaptureCallbackContainer.create(actualCallback); CaptureCallback callback = CaptureCallbackConverter.toCaptureCallback(callbackContainer); callback.onCaptureCompleted(mCameraCaptureSession, mCaptureRequest, mCaptureResult); verify(actualCallback, times(1)).onCaptureCompleted( any(CameraCaptureSession.class), any(CaptureRequest.class), any(TotalCaptureResult.class)); }
static CaptureCallback toCaptureCallback(CameraCaptureCallback cameraCaptureCallback) { if (cameraCaptureCallback == null) { return null; } List<CaptureCallback> list = new ArrayList<>(); toCaptureCallback(cameraCaptureCallback, list); return list.size() == 1 ? list.get(0) : Camera2CaptureCallbacks.createComboCallback(list); }
CaptureCallbackConverter { static CaptureCallback toCaptureCallback(CameraCaptureCallback cameraCaptureCallback) { if (cameraCaptureCallback == null) { return null; } List<CaptureCallback> list = new ArrayList<>(); toCaptureCallback(cameraCaptureCallback, list); return list.size() == 1 ? list.get(0) : Camera2CaptureCallbacks.createComboCallback(list); } }
CaptureCallbackConverter { static CaptureCallback toCaptureCallback(CameraCaptureCallback cameraCaptureCallback) { if (cameraCaptureCallback == null) { return null; } List<CaptureCallback> list = new ArrayList<>(); toCaptureCallback(cameraCaptureCallback, list); return list.size() == 1 ? list.get(0) : Camera2CaptureCallbacks.createComboCallback(list); } private  CaptureCallbackConverter(); }
CaptureCallbackConverter { static CaptureCallback toCaptureCallback(CameraCaptureCallback cameraCaptureCallback) { if (cameraCaptureCallback == null) { return null; } List<CaptureCallback> list = new ArrayList<>(); toCaptureCallback(cameraCaptureCallback, list); return list.size() == 1 ? list.get(0) : Camera2CaptureCallbacks.createComboCallback(list); } private  CaptureCallbackConverter();  }
CaptureCallbackConverter { static CaptureCallback toCaptureCallback(CameraCaptureCallback cameraCaptureCallback) { if (cameraCaptureCallback == null) { return null; } List<CaptureCallback> list = new ArrayList<>(); toCaptureCallback(cameraCaptureCallback, list); return list.size() == 1 ? list.get(0) : Camera2CaptureCallbacks.createComboCallback(list); } private  CaptureCallbackConverter();   }