KinectRecognizer { public void deallocate() throws KinectRecognizerException { if (handle == 0) { return; } try { kinectDeallocate(handle); } finally { handle = 0; } } KinectRecognizer(final KinectSpokenInput spokenInput); void allocate(); boolean isAllocated(); void startRecognition(); boolean isRecognizing(); void stopRecognition(); void deallocate();  }
@Test public void testDeallocate() throws Exception { final KinectRecognizer recognizer = new KinectRecognizer(null); recognizer.allocate(); Assert.assertTrue(recognizer.isAllocated()); recognizer.deallocate(); Assert.assertFalse(recognizer.isAllocated()); }