@Test
public void testFingerDistance() {

    PanZoom panZoom = spy(new PanZoom(xyPlot, PanZoom.Pan.BOTH, PanZoom.Zoom.SCALE));
    RectF distance = panZoom.fingerDistance(TestUtils.newPointerDownEvent(0, 0, 10, 10));
    assertEquals(0f, distance.left);
    assertEquals(0f, distance.top);
    assertEquals(10f, distance.right);
    assertEquals(10f, distance.bottom);
    // no matter what order the coords are supplied, make sure the same rect is calculated:
    distance = panZoom.fingerDistance(10, 10, 0, 0);
    assertEquals(0f, distance.left);
    assertEquals(0f, distance.top);
    assertEquals(10f, distance.right);
    assertEquals(10f, distance.bottom);
}