Code example for GestureDetector

0
    } 
 
    @Test 
    public void test_getListener() throws Exception { 
        TestOnGestureListener listener = new TestOnGestureListener();
        assertSame(listener, shadowOf(new GestureDetector(listener)).getListener());
        assertSame(listener, shadowOf(new GestureDetector(null, listener)).getListener());
    } 
 
    @Test 
    public void canAnswerLastGestureDetector() throws Exception { 
        GestureDetector newDetector = new GestureDetector(Robolectric.application, null);
        assertNotSame(newDetector, ShadowGestureDetector.getLastActiveDetector());
        newDetector.onTouchEvent(null);
        assertSame(newDetector, ShadowGestureDetector.getLastActiveDetector());
    } 
 
    @Test 
    public void getOnDoubleTapListener_shouldReturnSetDoubleTapListener() throws Exception { 
        GestureDetector subject = new GestureDetector(Robolectric.application, null);
        GestureDetector.OnDoubleTapListener onDoubleTapListener = new GestureDetector.OnDoubleTapListener() {