DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { public NicGeoPoint getDelta() { final NicGeoPoint tmpDelta = new NicGeoPointImpl(); synchronized (mutex) { tmpDelta.setXY(delta[0]*1000, delta[1]*1000); delta[0] = 0; delta[1] = 0; } return tmpDelta; } DeadReckoning(final Activity activity); void startSensors(); void stopSensors(); @Override void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data); @Override void onSensorChanged(final SensorEvent event); @Override void onAccuracyChanged(final Sensor sensor, final int accuracy); NicGeoPoint getDelta(); void setCompassFilterEnabled(boolean useLowPassFilter); void setBaseAngle(final double baseAngle);  }
@Test public void testClearDelta() { deadReckoning.delta[0] = 10.f; deadReckoning.delta[1] = 12.f; deadReckoning.getDelta(); assertTrue(0.f == deadReckoning.delta[0]); assertTrue(0.f == deadReckoning.delta[1]); }