CaptureCallbackAdapter extends CameraCaptureSession.CaptureCallback { @Override public void onCaptureCompleted( @NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull TotalCaptureResult result) { super.onCaptureCompleted(session, request, result); mCameraCaptureCallback.onCaptureCompleted( new Camera2CameraCaptureResult(request.getTag(), result)); } CaptureCallbackAdapter(CameraCaptureCallback cameraCaptureCallback); @Override void onCaptureCompleted(
            @NonNull CameraCaptureSession session,
            @NonNull CaptureRequest request,
            @NonNull TotalCaptureResult result); @Override void onCaptureFailed(
            @NonNull CameraCaptureSession session,
            @NonNull CaptureRequest request,
            @NonNull CaptureFailure failure);  }
@Test public void onCaptureCompleted() { mCaptureCallbackAdapter.onCaptureCompleted( mCameraCaptureSession, mCaptureRequest, mCaptureResult); verify(mCameraCaptureCallback, times(1)).onCaptureCompleted(any(CameraCaptureResult.class)); }