@Test
    public void touchesCircle() {
        //directly on line
        assertThat(circle(GP_1, 10, 0, false).touches(GP_1.project(180, 10), TO_LATLON_E6)).isTrue();

        //within "half linewidth" distance of line
        final int minLineWidth  = GeoItemUtils.getMinPixelTouchWidth();
        assertThat(circle(GP_1, 10, 0, false).touches(addE6(GP_1.project(180, 10), minLineWidth / 2, 0), TO_LATLON_E6)).isTrue();
        assertThat(circle(GP_1, 10, 0, false).touches(addE6(GP_1.project(180, 10), minLineWidth / 2 + 10, 0), TO_LATLON_E6)).isFalse();

        //inside
        assertThat(circle(GP_1, 10, 0, false).touches(GP_1, TO_LATLON_E6)).isFalse();
        assertThat(circle(GP_1, 10, 0, true).touches(GP_1, TO_LATLON_E6)).isTrue();
        assertThat(circle(GP_1, 10, 0, true).touches(addE6(GP_1.project(180, 10), - minLineWidth / 2 - 10, 0), TO_LATLON_E6)).isFalse();
    }
A fake bitmap provider used for testing touching routines
main/src/test/java/cgeo/geocaching/models/geoitem/GeoItemTest.java