@Test
public void start() throws Exception {

    ShakeDetector.ShakeListener mockListener = mock(ShakeDetector.ShakeListener.class);
    Sensor sensor = mock(Sensor.class);
    ShakeDetector detector = new ShakeDetector(mockListener,null);
    when(mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER)).thenReturn(sensor);
    detector.start(mSensorManager);
    verify(mSensorManager).getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    verify(mSensorManager).registerListener(detector,sensor,SensorManager.SENSOR_DELAY_UI);
}