private boolean addCollision(CollisionResults results, TerrainPatch patch, Vector3f intersection, Triangle hit, float distance) {
        CollisionResult cr = new CollisionResult(intersection.clone(), distance);
        cr.setGeometry(patch);
        cr.setContactNormal(hit.getNormal());
        cr.setTriangleIndex(hit.getIndex()); // this will probably always be 0

        for (int i = 0; i < results.size(); i++) {
            CollisionResult compare = results.getCollision(i);
            if (compare.getDistance() == cr.getDistance() && compare.getGeometry() == cr.getGeometry() &&
                compare.getContactPoint().equals(cr.getContactPoint()) &&
                compare.getContactNormal().equals(cr.getContactNormal())) {
                    return false; // Collision already available, deduplicate.
            }
        }

        results.addCollision(cr);
        return true;
    }
This method adds the found Collision to an existing collisionResult.
@param results The results to add this collision to
@param patch The TerrainPatch which collided
@param intersection The actual intersection position
@param hit The hit triangle
@param distance The distance at which the hit occurred
@return Whether the collision was accepted to the list or whether it has been deduplicated
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/BresenhamTerrainPicker.java