### Question:
SliderPanel extends FrameLayout { @Override public boolean onInterceptTouchEvent(MotionEvent ev) { boolean interceptForDrag; if(isLocked){ return false; } if(config.isEdgeOnly()) { isEdgeTouched = canDragFromEdge(ev); } try { interceptForDrag = dragHelper.shouldInterceptTouchEvent(ev); } catch (Exception e) { interceptForDrag = false; } return interceptForDrag && !isLocked; } SliderPanel(Context context);  SliderPanel(Context context, View decorView, SlidrConfig config); @Override boolean onInterceptTouchEvent(MotionEvent ev); @Override boolean onTouchEvent(MotionEvent event); @Override void computeScroll(); void setOnPanelSlideListener(OnPanelSlideListener listener); SlidrInterface getDefaultInterface();  }### Answer:
@Test public void testOnInterceptTouchEvent_whenLocked() throws Exception { SliderPanel sliderPanel = new SliderPanel(context); setInternalState(sliderPanel, "isLocked", true); boolean result = sliderPanel.onInterceptTouchEvent(motionEvent); assertFalse("Result must be false when isLocked is true", result); }
@Test public void testOnInterceptTouchEvent_whenNotLoacked_edgeOnly() throws Exception { SliderPanel sliderPanel = Mockito.spy(new SliderPanel(context)); PowerMockito.when(sliderPanel, "getWidth").thenReturn(10); SlidrConfig slidrConfig = Mockito.mock(SlidrConfig.class); when(slidrConfig.isEdgeOnly()).thenReturn(true); when(slidrConfig.getPosition()).thenReturn(SlidrPosition.LEFT); when(slidrConfig.getEdgeSize(Matchers.anyInt())).thenReturn(10.1f); setInternalState(sliderPanel, "isLocked", false); setInternalState(sliderPanel, "config", slidrConfig); boolean result = sliderPanel.onInterceptTouchEvent(motionEvent); assertFalse("Result must be false", result); }