0
  public void testClearPreviewCallback() throws Exception { 
    TestPreviewCallback callback = new TestPreviewCallback();
    assertThat(callback.camera).isNull();
    assertThat(callback.data).isNull();
 
    camera.setPreviewCallback(callback);
    camera.setPreviewCallback(null);
 
    shadowCamera.invokePreviewCallback("foobar".getBytes());
    assertThat(callback.camera).isNull();
    assertThat(callback.data).isNull();
 
    camera.setOneShotPreviewCallback(callback);
    camera.setOneShotPreviewCallback(null);
 
    shadowCamera.invokePreviewCallback("foobar".getBytes());
    assertThat(callback.camera).isNull();
    assertThat(callback.data).isNull();
 
    camera.setPreviewCallbackWithBuffer(callback);
    camera.setPreviewCallbackWithBuffer(null);
 
    shadowCamera.invokePreviewCallback("foobar".getBytes());
    assertThat(callback.camera).isNull();
    assertThat(callback.data).isNull();
  } 
Stop searching for code, let great code find you!  Add Codota to your java IDE