/** * Convenience method for * {@link Graphs#findClosestObject(Point, Collection, Function)}. * @param pos The {@link Point} which is used as reference. * @param rm The {@link RoadModel} which is searched. * @param objects The {@link Collection} which is searched, each object must * exist in <code>rm</code>. * @param <T> The type of the returned object. * @return The closest object in <code>rm</code> to <code>pos</code> which * satisfies the <code>predicate</code>. * @see Graphs#findClosestObject(Point, Collection, Function) */ @Nullable public static <T extends RoadUser> T findClosestObject(Point pos, RoadModel rm, Collection<T> objects) { return Graphs.findClosestObject(pos, objects, new RoadModels.RoadUserToPositionFunction<T>(rm)); }