Repository: graphhopper/graphhopper
Pull request #2294 (2021-04-23 10:57:21)

Rename: DefaultEdgeFilter -> AccessFilter
The name 'default' is no longer justified. In many cases we rather filter by edge weight than simply checking the access flags. 



Patch:
diff --git a/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java b/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
index b48e92cec..e532d041e 100644
--- a/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
+++ b/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
@@ -18,7 +18,7 @@
 package com.graphhopper.routing;
 
 import com.graphhopper.routing.ev.*;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.FlagEncoder;
 import com.graphhopper.routing.weighting.Weighting;
 import com.graphhopper.storage.Graph;
@@ -98,8 +98,8 @@ public class InstructionsFromEdges implements Path.EdgeVisitor {
         prevNode = -1;
         prevInRoundabout = false;
         prevName = null;
-        outEdgeExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc()));
-        crossingExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.allEdges(encoder.getAccessEnc()));
+        outEdgeExplorer = graph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc()));
+        crossingExplorer = graph.createEdgeExplorer(AccessFilter.allEdges(encoder.getAccessEnc()));
     }
 
     /**
diff --git a/core/src/main/java/com/graphhopper/routing/ch/ShortcutFilter.java b/core/src/main/java/com/graphhopper/routing/ch/ShortcutFilter.java
index 65906f10f..bdda1deb7 100644
--- a/core/src/main/java/com/graphhopper/routing/ch/ShortcutFilter.java
+++ b/core/src/main/java/com/graphhopper/routing/ch/ShortcutFilter.java
@@ -42,7 +42,7 @@ public class ShortcutFilter {
     }
 
     public boolean accept(CHEdgeIteratorState edgeState) {
-        // c.f. comment in DefaultEdgeFilter
+        // c.f. comment in AccessFilter
         if (edgeState.getBaseNode() == edgeState.getAdjNode()) {
             return edgeState.getFwdAccess() || edgeState.getBwdAccess();
         }
diff --git a/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java b/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java
index 8c60dd734..4e2fbf244 100644
--- a/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java
+++ b/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java
@@ -254,7 +254,7 @@ public class LandmarkStorage implements Storable<LandmarkStorage> {
         // we cannot reuse the components calculated in PrepareRoutingSubnetworks as the edgeIds changed in between (called graph.optimize)
         // also calculating subnetworks from scratch makes bigger problems when working with many oneways
         final EdgeFilter tmpFilter = tarjanFilter;
-        EdgeFilter edgeFilter = edge -> DefaultEdgeFilter.outEdges(encoder.getAccessEnc()).accept(edge) && tmpFilter.accept(edge);
+        EdgeFilter edgeFilter = edge -> AccessFilter.outEdges(encoder.getAccessEnc()).accept(edge) && tmpFilter.accept(edge);
         ConnectedComponents graphComponents = TarjanSCC.findComponents(graph, edgeFilter, true);
         if (logDetails)
             LOGGER.info("Calculated " + graphComponents.getComponents().size() + " subnetworks via tarjan in " + sw.stop().getSeconds() + "s, " + Helper.getMemInfo());
diff --git a/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java b/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java
index 51de17712..2f422469b 100644
--- a/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java
+++ b/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java
@@ -22,7 +22,7 @@ import com.carrotsearch.hppc.BitSetIterator;
 import com.carrotsearch.hppc.IntArrayList;
 import com.carrotsearch.hppc.cursors.IntCursor;
 import com.graphhopper.routing.ev.BooleanEncodedValue;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.weighting.TurnCostProvider;
 import com.graphhopper.storage.GraphHopperStorage;
 import com.graphhopper.util.*;
@@ -93,7 +93,7 @@ public class PrepareRoutingSubnetworks {
     private int removeSmallSubNetworksEdgeBased(String jobName, BooleanEncodedValue accessEnc, TurnCostProvider turnCostProvider) {
         // partition graph into strongly connected components using Tarjan's algorithm
         StopWatch sw = new StopWatch().start();
-        EdgeBasedTarjanSCC.ConnectedComponents ccs = EdgeBasedTarjanSCC.findComponents(ghStorage, DefaultEdgeFilter.outEdges(accessEnc), turnCostProvider, false);
+        EdgeBasedTarjanSCC.ConnectedComponents ccs = EdgeBasedTarjanSCC.findComponents(ghStorage, AccessFilter.outEdges(accessEnc), turnCostProvider, false);
         List<IntArrayList> components = ccs.getComponents();
         BitSet singleEdgeComponents = ccs.getSingleEdgeComponents();
         long numSingleEdgeComponents = singleEdgeComponents.cardinality();
diff --git a/core/src/main/java/com/graphhopper/routing/util/DefaultEdgeFilter.java b/core/src/main/java/com/graphhopper/routing/util/AccessFilter.java
similarity index 78%
rename from core/src/main/java/com/graphhopper/routing/util/DefaultEdgeFilter.java
rename to core/src/main/java/com/graphhopper/routing/util/AccessFilter.java
index 70d2166a5..4f48149c1 100644
--- a/core/src/main/java/com/graphhopper/routing/util/DefaultEdgeFilter.java
+++ b/core/src/main/java/com/graphhopper/routing/util/AccessFilter.java
@@ -23,23 +23,23 @@ import com.graphhopper.util.EdgeIteratorState;
 /**
  * @author Peter Karich
  */
-public class DefaultEdgeFilter implements EdgeFilter {
+public class AccessFilter implements EdgeFilter {
     private final boolean bwd;
     private final boolean fwd;
     private final BooleanEncodedValue accessEnc;
 
-    private DefaultEdgeFilter(BooleanEncodedValue accessEnc, boolean fwd, boolean bwd) {
+    private AccessFilter(BooleanEncodedValue accessEnc, boolean fwd, boolean bwd) {
         this.accessEnc = accessEnc;
         this.fwd = fwd;
         this.bwd = bwd;
     }
 
-    public static DefaultEdgeFilter outEdges(BooleanEncodedValue accessEnc) {
-        return new DefaultEdgeFilter(accessEnc, true, false);
+    public static AccessFilter outEdges(BooleanEncodedValue accessEnc) {
+        return new AccessFilter(accessEnc, true, false);
     }
 
-    public static DefaultEdgeFilter inEdges(BooleanEncodedValue accessEnc) {
-        return new DefaultEdgeFilter(accessEnc, false, true);
+    public static AccessFilter inEdges(BooleanEncodedValue accessEnc) {
+        return new AccessFilter(accessEnc, false, true);
     }
 
     /**
@@ -47,8 +47,8 @@ public class DefaultEdgeFilter implements EdgeFilter {
      * Edges where neither one of the flags is enabled will still not be accepted. If you need to retrieve all edges
      * regardless of their encoding use {@link EdgeFilter#ALL_EDGES} instead.
      */
-    public static DefaultEdgeFilter allEdges(BooleanEncodedValue accessEnc) {
-        return new DefaultEdgeFilter(accessEnc, true, true);
+    public static AccessFilter allEdges(BooleanEncodedValue accessEnc) {
+        return new AccessFilter(accessEnc, true, true);
     }
 
     public BooleanEncodedValue getAccessEnc() {
@@ -60,7 +60,7 @@ public class DefaultEdgeFilter implements EdgeFilter {
         if (iter.getBaseNode() == iter.getAdjNode()) {
             // this is needed for edge-based CH, see #1525
             // background: we need to explicitly accept shortcut edges that are loops, because if we insert a loop
-            // shortcut with the fwd flag a DefaultEdgeFilter with bwd=true and fwd=false does not find it, although
+            // shortcut with the fwd flag an AccessFilter with bwd=true and fwd=false does not find it, although
             // it is also an 'incoming' edge.
             return iter.get(accessEnc) || iter.getReverse(accessEnc);
         }
@@ -77,7 +77,7 @@ public class DefaultEdgeFilter implements EdgeFilter {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
 
-        DefaultEdgeFilter that = (DefaultEdgeFilter) o;
+        AccessFilter that = (AccessFilter) o;
 
         if (bwd != that.bwd) return false;
         if (fwd != that.fwd) return false;
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java
index ec62aa1dd..6553de642 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java
@@ -19,7 +19,7 @@ package com.graphhopper.routing.util.parsers;
 
 import com.graphhopper.reader.OSMTurnRelation;
 import com.graphhopper.routing.ev.*;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.storage.Graph;
 import com.graphhopper.storage.TurnCostStorage;
 import com.graphhopper.util.EdgeExplorer;
@@ -73,11 +73,11 @@ public class OSMTurnRelationParser implements TurnCostParser {
     }
 
     private EdgeExplorer getInExplorer(Graph graph) {
-        return cachedInExplorer == null ? cachedInExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.inEdges(accessEnc)) : cachedInExplorer;
+        return cachedInExplorer == null ? cachedInExplorer = graph.createEdgeExplorer(AccessFilter.inEdges(accessEnc)) : cachedInExplorer;
     }
 
     private EdgeExplorer getOutExplorer(Graph graph) {
-        return cachedOutExplorer == null ? cachedOutExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(accessEnc)) : cachedOutExplorer;
+        return cachedOutExplorer == null ? cachedOutExplorer = graph.createEdgeExplorer(AccessFilter.outEdges(accessEnc)) : cachedOutExplorer;
     }
 
     /**
diff --git a/core/src/main/java/com/graphhopper/storage/RoutingCHEdgeIteratorImpl.java b/core/src/main/java/com/graphhopper/storage/RoutingCHEdgeIteratorImpl.java
index a1448ddcd..69778b340 100644
--- a/core/src/main/java/com/graphhopper/storage/RoutingCHEdgeIteratorImpl.java
+++ b/core/src/main/java/com/graphhopper/storage/RoutingCHEdgeIteratorImpl.java
@@ -76,7 +76,7 @@ public class RoutingCHEdgeIteratorImpl extends RoutingCHEdgeIteratorStateImpl im
         if (isShortcut()) {
             return shortcutFilter.accept((CHEdgeIteratorState) edgeIterator);
         } else {
-            // c.f. comment in DefaultEdgeFilter
+            // c.f. comment in AccessFilter
             if (edgeIterator.getBaseNode() == edgeIterator.getAdjNode()) {
                 return finiteWeight(false) || finiteWeight(true);
             }
diff --git a/core/src/main/java/com/graphhopper/storage/index/LocationIndex.java b/core/src/main/java/com/graphhopper/storage/index/LocationIndex.java
index 7c27923b6..acf892f13 100644
--- a/core/src/main/java/com/graphhopper/storage/index/LocationIndex.java
+++ b/core/src/main/java/com/graphhopper/storage/index/LocationIndex.java
@@ -40,7 +40,7 @@ public interface LocationIndex extends Storable<LocationIndex> {
      *
      * @param edgeFilter if a graph supports multiple vehicles we have to make sure that the entry
      *                   node into the graph is accessible from a selected vehicle. E.g. if you have a FOOT-query do:
-     *                   <pre>DefaultEdgeFilter.allEdges(footFlagEncoder);</pre>
+     *                   <pre>AccessFilter.allEdges(footFlagEncoder);</pre>
      * @return An object containing the closest node and edge for the specified location. The node id
      * has at least one edge which is accepted by the specified edgeFilter. If nothing is found
      * the method Snap.isValid will return false.
diff --git a/core/src/main/java/com/graphhopper/util/GHUtility.java b/core/src/main/java/com/graphhopper/util/GHUtility.java
index a78ba0851..f96c08c42 100644
--- a/core/src/main/java/com/graphhopper/util/GHUtility.java
+++ b/core/src/main/java/com/graphhopper/util/GHUtility.java
@@ -240,8 +240,8 @@ public class GHUtility {
         double pCostIsRestriction = 0.1;
 
         DecimalEncodedValue turnCostEnc = em.getDecimalEncodedValue(TurnCost.key(encoder.toString()));
-        EdgeExplorer inExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.inEdges(encoder.getAccessEnc()));
-        EdgeExplorer outExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc()));
+        EdgeExplorer inExplorer = graph.createEdgeExplorer(AccessFilter.inEdges(encoder.getAccessEnc()));
+        EdgeExplorer outExplorer = graph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc()));
         for (int node = 0; node < graph.getNodes(); ++node) {
             if (random.nextDouble() < pNodeHasTurnCosts) {
                 EdgeIterator inIter = inExplorer.setBaseNode(node);
diff --git a/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphExplorer.java b/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphExplorer.java
index 08a34fc78..dafc6974e 100644
--- a/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphExplorer.java
+++ b/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphExplorer.java
@@ -21,7 +21,7 @@ package com.graphhopper.gtfs;
 import com.graphhopper.routing.ev.BooleanEncodedValue;
 import com.graphhopper.routing.ev.EnumEncodedValue;
 import com.graphhopper.routing.ev.IntEncodedValue;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EdgeFilter;
 import com.graphhopper.routing.weighting.Weighting;
 import com.graphhopper.storage.Graph;
@@ -59,10 +59,10 @@ public final class GraphExplorer {
         this.accessEnc = accessEgressWeighting.getFlagEncoder().getAccessEnc();
         this.ignoreValidities = ignoreValidities;
         this.blockedRouteTypes = blockedRouteTypes;
-        DefaultEdgeFilter accessEgressIn = DefaultEdgeFilter.inEdges(accessEgressWeighting.getFlagEncoder().getAccessEnc());
-        DefaultEdgeFilter accessEgressOut = DefaultEdgeFilter.outEdges(accessEgressWeighting.getFlagEncoder().getAccessEnc());
-        DefaultEdgeFilter ptIn = DefaultEdgeFilter.inEdges(flagEncoder.getAccessEnc());
-        DefaultEdgeFilter ptOut = DefaultEdgeFilter.outEdges(flagEncoder.getAccessEnc());
+        AccessFilter accessEgressIn = AccessFilter.inEdges(accessEgressWeighting.getFlagEncoder().getAccessEnc());
+        AccessFilter accessEgressOut = AccessFilter.outEdges(accessEgressWeighting.getFlagEncoder().getAccessEnc());
+        AccessFilter ptIn = AccessFilter.inEdges(flagEncoder.getAccessEnc());
+        AccessFilter ptOut = AccessFilter.outEdges(flagEncoder.getAccessEnc());
         EdgeFilter in = edgeState -> accessEgressIn.accept(edgeState) || ptIn.accept(edgeState);
         EdgeFilter out = edgeState -> accessEgressOut.accept(edgeState) || ptOut.accept(edgeState);
         this.edgeExplorer = graph.createEdgeExplorer(reverse ? in : out);
diff --git a/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphHopperGtfs.java b/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphHopperGtfs.java
index fb463f7e4..3829ee9ee 100644
--- a/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphHopperGtfs.java
+++ b/reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphHopperGtfs.java
@@ -24,8 +24,7 @@ import com.graphhopper.GraphHopper;
 import com.graphhopper.GraphHopperConfig;
 import com.graphhopper.routing.ev.EnumEncodedValue;
 import com.graphhopper.routing.querygraph.QueryGraph;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
-import com.graphhopper.routing.util.EncodingManager;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.weighting.FastestWeighting;
 import com.graphhopper.storage.Directory;
 import com.graphhopper.storage.GraphHopperStorage;
@@ -156,7 +155,7 @@ public class GraphHopperGtfs extends GraphHopper {
                     if (edgeIteratorState.get(ptEncodedValues.getTypeEnc()) == GtfsStorage.EdgeType.EXIT_PT) {
                         GtfsStorageI.PlatformDescriptor fromPlatformDescriptor = getGtfsStorage().getPlatformDescriptorByEdge().get(label.edge);
                         Transfers transfers = allTransfers.get(fromPlatformDescriptor.feed_id);
-                        DefaultEdgeFilter filter = DefaultEdgeFilter.outEdges(ptEncodedValues.getAccessEnc());
+                        AccessFilter filter = AccessFilter.outEdges(ptEncodedValues.getAccessEnc());
                         EdgeExplorer edgeExplorer = graphHopperStorage.createEdgeExplorer(filter);
                         EdgeIterator edgeIterator = edgeExplorer.setBaseNode(stationNode);
                         while (edgeIterator.next()) {
diff --git a/reader-gtfs/src/main/java/com/graphhopper/gtfs/GtfsReader.java b/reader-gtfs/src/main/java/com/graphhopper/gtfs/GtfsReader.java
index 159d6e831..32c195abf 100644
--- a/reader-gtfs/src/main/java/com/graphhopper/gtfs/GtfsReader.java
+++ b/reader-gtfs/src/main/java/com/graphhopper/gtfs/GtfsReader.java
@@ -25,7 +25,7 @@ import com.google.common.collect.HashMultimap;
 import com.google.transit.realtime.GtfsRealtime;
 import com.graphhopper.routing.ev.BooleanEncodedValue;
 import com.graphhopper.routing.ev.IntEncodedValue;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EdgeFilter;
 import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.FlagEncoder;
@@ -109,7 +109,7 @@ class GtfsReader {
 
     void connectStopsToStreetNetwork() {
         FlagEncoder footEncoder = ((GraphHopperStorage) graph).getEncodingManager().getEncoder("foot");
-        final EdgeFilter filter = DefaultEdgeFilter.allEdges(footEncoder.getAccessEnc());
+        final EdgeFilter filter = AccessFilter.allEdges(footEncoder.getAccessEnc());
         for (Stop stop : feed.stops.values()) {
             if (stop.location_type == 0) { // Only stops. Not interested in parent stations for now.
                 Snap locationSnap = walkNetworkIndex.findClosest(stop.stop_lat, stop.stop_lon, filter);
@@ -472,7 +472,7 @@ class GtfsReader {
         if (platformEnterNode == -1) {
             return result;
         }
-        EdgeIterator edge = graph.getBaseGraph().createEdgeExplorer(DefaultEdgeFilter.outEdges(accessEnc)).setBaseNode(platformEnterNode);
+        EdgeIterator edge = graph.getBaseGraph().createEdgeExplorer(AccessFilter.outEdges(accessEnc)).setBaseNode(platformEnterNode);
         while (edge.next()) {
             if (edge.get(ptEncodedValues.getTypeEnc()) == GtfsStorage.EdgeType.ENTER_TIME_EXPANDED_NETWORK) {
                 result.put(edge.get(timeEnc), edge.getAdjNode());
@@ -482,11 +482,11 @@ class GtfsReader {
     }
 
     private int findPlatformNode(int stationNode, GtfsStorageI.PlatformDescriptor platformDescriptor, GtfsStorage.EdgeType edgeType) {
-        DefaultEdgeFilter filter;
+        AccessFilter filter;
         if (edgeType == GtfsStorage.EdgeType.ENTER_PT) {
-            filter = DefaultEdgeFilter.outEdges(accessEnc);
+            filter = AccessFilter.outEdges(accessEnc);
         } else if (edgeType == GtfsStorage.EdgeType.EXIT_PT) {
-            filter = DefaultEdgeFilter.inEdges(accessEnc);
+            filter = AccessFilter.inEdges(accessEnc);
         } else {
             throw new RuntimeException();
         }
diff --git a/reader-gtfs/src/main/java/com/graphhopper/gtfs/PtRouterImpl.java b/reader-gtfs/src/main/java/com/graphhopper/gtfs/PtRouterImpl.java
index 02b29f958..b28972f35 100644
--- a/reader-gtfs/src/main/java/com/graphhopper/gtfs/PtRouterImpl.java
+++ b/reader-gtfs/src/main/java/com/graphhopper/gtfs/PtRouterImpl.java
@@ -25,7 +25,7 @@ import com.graphhopper.GraphHopper;
 import com.graphhopper.ResponsePath;
 import com.graphhopper.routing.querygraph.QueryGraph;
 import com.graphhopper.routing.querygraph.VirtualEdgeIteratorState;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EdgeFilter;
 import com.graphhopper.routing.weighting.FastestWeighting;
 import com.graphhopper.routing.weighting.Weighting;
@@ -188,7 +188,7 @@ public final class PtRouterImpl implements PtRouter {
         }
 
         private Snap findByPoint(GHPoint point, int indexForErrorMessage) {
-            final EdgeFilter filter = DefaultEdgeFilter.allEdges(graphHopperStorage.getEncodingManager().getEncoder("foot").getAccessEnc());
+            final EdgeFilter filter = AccessFilter.allEdges(graphHopperStorage.getEncodingManager().getEncoder("foot").getAccessEnc());
             Snap source = locationIndex.findClosest(point.lat, point.lon, filter);
             if (!source.isValid()) {
                 throw new PointNotFoundException("Cannot find point: " + point, indexForErrorMessage);
diff --git a/tools/src/main/java/com/graphhopper/tools/Measurement.java b/tools/src/main/java/com/graphhopper/tools/Measurement.java
index ed2c0bd8f..c933cca41 100644
--- a/tools/src/main/java/com/graphhopper/tools/Measurement.java
+++ b/tools/src/main/java/com/graphhopper/tools/Measurement.java
@@ -447,7 +447,7 @@ public class Measurement {
     private void measureGraphTraversal(final Graph graph, final FlagEncoder encoder, int count) {
         final Random rand = new Random(seed);
 
-        EdgeFilter outFilter = DefaultEdgeFilter.outEdges(encoder.getAccessEnc());
+        EdgeFilter outFilter = AccessFilter.outEdges(encoder.getAccessEnc());
         final EdgeExplorer outExplorer = graph.createEdgeExplorer(outFilter);
         MiniPerfTest miniPerf = new MiniPerfTest().setIterations(count).start((warmup, run) -> {
             int nodeId = rand.nextInt(maxNode);
@@ -488,7 +488,7 @@ public class Measurement {
         });
         print("unit_testsCH.get_weight", miniPerf);
 
-        EdgeFilter outFilter = DefaultEdgeFilter.outEdges(encoder.getAccessEnc());
+        EdgeFilter outFilter = AccessFilter.outEdges(encoder.getAccessEnc());
         final CHEdgeExplorer outExplorer = lg.createEdgeExplorer(outFilter);
         miniPerf = new MiniPerfTest().setIterations(count).start((warmup, run) -> {
             int nodeId = rand.nextInt(maxNode);
@@ -607,7 +607,7 @@ public class Measurement {
         final AtomicInteger failedCount = new AtomicInteger(0);
         final DistanceCalc distCalc = new DistanceCalcEarth();
 
-        final EdgeFilter edgeFilter = DefaultEdgeFilter.allEdges(hopper.getEncodingManager().getEncoder(vehicle).getAccessEnc());
+        final EdgeFilter edgeFilter = AccessFilter.allEdges(hopper.getEncodingManager().getEncoder(vehicle).getAccessEnc());
         final EdgeExplorer edgeExplorer = g.createEdgeExplorer(edgeFilter);
         final AtomicLong visitedNodesSum = new AtomicLong(0);
         final AtomicLong maxVisitedNodes = new AtomicLong(0);
diff --git a/tools/src/main/java/com/graphhopper/ui/MiniGraphUI.java b/tools/src/main/java/com/graphhopper/ui/MiniGraphUI.java
index 3e09738d8..d80d97841 100644
--- a/tools/src/main/java/com/graphhopper/ui/MiniGraphUI.java
+++ b/tools/src/main/java/com/graphhopper/ui/MiniGraphUI.java
@@ -405,7 +405,7 @@ public class MiniGraphUI {
 //
 ////        System.out.println("path " + from + "->" + to);
 //        return algo.calcPath(from, to);
-        // System.out.println(GraphUtility.getNodeInfo(graph, 60139, DefaultEdgeFilter.allEdges(new CarFlagEncoder()).direction(false, true)));
+        // System.out.println(GraphUtility.getNodeInfo(graph, 60139, AccessFilter.allEdges(new CarFlagEncoder()).direction(false, true)));
         // System.out.println(((GraphStorage) graph).debug(202947, 10));
 //        GraphUtility.printInfo(graph, 106511, 10);
         return algo.calcPath(162810, 35120);
diff --git a/web-bundle/src/main/java/com/graphhopper/resources/PtIsochroneResource.java b/web-bundle/src/main/java/com/graphhopper/resources/PtIsochroneResource.java
index 9b4727f11..ed412c072 100644
--- a/web-bundle/src/main/java/com/graphhopper/resources/PtIsochroneResource.java
+++ b/web-bundle/src/main/java/com/graphhopper/resources/PtIsochroneResource.java
@@ -23,7 +23,7 @@ import com.graphhopper.isochrone.algorithm.ContourBuilder;
 import com.graphhopper.isochrone.algorithm.ReadableTriangulation;
 import com.graphhopper.jackson.ResponsePathSerializer;
 import com.graphhopper.routing.querygraph.QueryGraph;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EdgeFilter;
 import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.weighting.FastestWeighting;
@@ -98,7 +98,7 @@ public class PtIsochroneResource {
         double targetZ = initialTime.toEpochMilli() + seconds * 1000;
 
         GeometryFactory geometryFactory = new GeometryFactory();
-        final EdgeFilter filter = DefaultEdgeFilter.allEdges(graphHopperStorage.getEncodingManager().getEncoder("foot").getAccessEnc());
+        final EdgeFilter filter = AccessFilter.allEdges(graphHopperStorage.getEncodingManager().getEncoder("foot").getAccessEnc());
         Snap snap = locationIndex.findClosest(source.lat, source.lon, filter);
         QueryGraph queryGraph = QueryGraph.create(graphHopperStorage, Collections.singletonList(snap));
         if (!snap.isValid()) {


Test patch:
diff --git a/core/src/test/java/com/graphhopper/routing/DirectionResolverOnQueryGraphTest.java b/core/src/test/java/com/graphhopper/routing/DirectionResolverOnQueryGraphTest.java
index 3f7d2142c..053bd1ad0 100644
--- a/core/src/test/java/com/graphhopper/routing/DirectionResolverOnQueryGraphTest.java
+++ b/core/src/test/java/com/graphhopper/routing/DirectionResolverOnQueryGraphTest.java
@@ -31,8 +31,8 @@ import com.graphhopper.util.EdgeExplorer;
 import com.graphhopper.util.EdgeIterator;
 import com.graphhopper.util.EdgeIteratorState;
 import com.graphhopper.util.GHUtility;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -40,8 +40,7 @@ import java.util.List;
 import static com.graphhopper.routing.DirectionResolverResult.unrestricted;
 import static com.graphhopper.util.EdgeIterator.NO_EDGE;
 import static com.graphhopper.util.Helper.createPointList;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * This test simulates incoming lat/lon coordinates that get snapped to graph edges (using {@link QueryGraph}) and the
@@ -56,7 +55,7 @@ public class DirectionResolverOnQueryGraphTest {
     private Graph graph;
     private LocationIndexTree locationIndex;
 
-    @Before
+    @BeforeEach
     public void setup() {
         encoder = new CarFlagEncoder();
         graph = new GraphBuilder(EncodingManager.create(encoder)).create();
@@ -281,9 +280,10 @@ public class DirectionResolverOnQueryGraphTest {
         queryGraph = QueryGraph.create(graph, snaps);
         DirectionResolver resolver = new DirectionResolver(queryGraph, this::isAccessible);
         for (int i = 0; i < expectedResults.length; i++) {
-            assertEquals("unexpected resolved direction",
+            assertEquals(
                     restrictedDirection(expectedResults[i]),
-                    resolver.resolveDirections(snaps.get(i).getClosestNode(), snaps.get(i).getQueryPoint()));
+                    resolver.resolveDirections(snaps.get(i).getClosestNode(), snaps.get(i).getQueryPoint()),
+                    "unexpected resolved direction");
         }
     }
 
@@ -315,7 +315,7 @@ public class DirectionResolverOnQueryGraphTest {
     }
 
     private int findEdge(int from, int to) {
-        EdgeExplorer explorer = queryGraph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc()));
+        EdgeExplorer explorer = queryGraph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc()));
         EdgeIterator iter = explorer.setBaseNode(from);
         while (iter.next()) {
             if (iter.getAdjNode() == to) {
diff --git a/core/src/test/java/com/graphhopper/routing/DirectionResolverTest.java b/core/src/test/java/com/graphhopper/routing/DirectionResolverTest.java
index 7898d039f..5cd54877a 100644
--- a/core/src/test/java/com/graphhopper/routing/DirectionResolverTest.java
+++ b/core/src/test/java/com/graphhopper/routing/DirectionResolverTest.java
@@ -20,7 +20,7 @@ package com.graphhopper.routing;
 import com.graphhopper.routing.ev.BooleanEncodedValue;
 import com.graphhopper.routing.querygraph.QueryGraph;
 import com.graphhopper.routing.util.CarFlagEncoder;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.FlagEncoder;
 import com.graphhopper.storage.GraphBuilder;
@@ -31,12 +31,13 @@ import com.graphhopper.util.EdgeIterator;
 import com.graphhopper.util.EdgeIteratorState;
 import com.graphhopper.util.GHUtility;
 import com.graphhopper.util.shapes.GHPoint;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 import static com.graphhopper.routing.DirectionResolverResult.*;
 import static com.graphhopper.util.Helper.createPointList;
-import static org.junit.Assert.assertEquals;
 
 /**
  * Tests {@link DirectionResolver} on a simple graph (no {@link QueryGraph}.
@@ -48,7 +49,7 @@ public class DirectionResolverTest {
     private GraphHopperStorage graph;
     private NodeAccess na;
 
-    @Before
+    @BeforeEach
     public void setup() {
         encoder = new CarFlagEncoder();
         graph = new GraphBuilder(EncodingManager.create(encoder)).create();
@@ -401,7 +402,7 @@ public class DirectionResolverTest {
     }
 
     private int edge(int from, int to) {
-        EdgeExplorer explorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc()));
+        EdgeExplorer explorer = graph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc()));
         EdgeIterator iter = explorer.setBaseNode(from);
         while (iter.next()) {
             if (iter.getAdjNode() == to) {
diff --git a/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java b/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java
index 2e0dc0643..8815ee54d 100644
--- a/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java
+++ b/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java
@@ -634,8 +634,8 @@ public class CHTurnCostTest {
             }
         }
         graph.freeze();
-        EdgeExplorer inExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.inEdges(encoder.getAccessEnc()));
-        EdgeExplorer outExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc()));
+        EdgeExplorer inExplorer = graph.createEdgeExplorer(AccessFilter.inEdges(encoder.getAccessEnc()));
+        EdgeExplorer outExplorer = graph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc()));
 
         // add turn costs or restrictions
         for (int node = 0; node < size * size; ++node) {
diff --git a/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java b/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java
index 888e5049f..2c2bbfd69 100644
--- a/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java
+++ b/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java
@@ -30,13 +30,13 @@ import com.graphhopper.routing.weighting.Weighting;
 import com.graphhopper.storage.*;
 import com.graphhopper.storage.index.Snap;
 import com.graphhopper.util.*;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.*;
 
 import static com.graphhopper.util.GHUtility.updateDistancesFor;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * @author Peter Karich
@@ -118,7 +118,7 @@ public class PrepareContractionHierarchiesTest {
         GHUtility.setSpeed(60, true, true, encoder, g.edge(5, 1).setDistance(2));
     }
 
-    @Before
+    @BeforeEach
     public void setUp() {
         g = createGHStorage();
         lg = g.getCHGraph();
@@ -370,7 +370,7 @@ public class PrepareContractionHierarchiesTest {
         // prepare ch, use node ids as levels
         PrepareContractionHierarchies pch = createPrepareContractionHierarchies(g, chConfig);
         pch.useFixedNodeOrdering(NodeOrderingProvider.identity(g.getNodes())).doWork();
-        assertEquals("there should be exactly two (bidirectional) shortcuts (2-3) and (3-4)", 2, lg.getEdges() - lg.getOriginalEdges());
+        assertEquals(2, lg.getEdges() - lg.getOriginalEdges(), "there should be exactly two (bidirectional) shortcuts (2-3) and (3-4)");
 
         // insert virtual node and edges
         Snap snap = new Snap(0.0001, 0.0015);
@@ -388,11 +388,11 @@ public class PrepareContractionHierarchiesTest {
         double scWeight34 = weight03 + getEdge(lg, 3, 4, false).getWeight();
         double sptWeight2 = weight03 + getWeight(queryGraph, fastestWeighting, 3, 8, false) + getWeight(queryGraph, fastestWeighting, 8, 1, false) + getWeight(queryGraph, fastestWeighting, 1, 2, false);
         double sptWeight4 = sptWeight2 + getWeight(queryGraph, fastestWeighting, 2, 4, false);
-        assertTrue("incoming shortcut weight 3->2 should be smaller than sptWeight at node 2 to make sure 2 gets stalled", scWeight23 < sptWeight2);
-        assertTrue("sptWeight at node 4 should be smaller than shortcut weight 3->4 to make sure node 4 gets stalled", sptWeight4 < scWeight34);
+        assertTrue(scWeight23 < sptWeight2, "incoming shortcut weight 3->2 should be smaller than sptWeight at node 2 to make sure 2 gets stalled");
+        assertTrue(sptWeight4 < scWeight34, "sptWeight at node 4 should be smaller than shortcut weight 3->4 to make sure node 4 gets stalled");
 
         Path path = new CHRoutingAlgorithmFactory(routingCHGraph, queryGraph).createAlgo(new PMap()).calcPath(0, 7);
-        assertEquals("wrong or no path found", IntArrayList.from(0, 3, 8, 1, 2, 4, 5, 6, 7), path.calcNodes());
+        assertEquals(IntArrayList.from(0, 3, 8, 1, 2, 4, 5, 6, 7), path.calcNodes(), "wrong or no path found");
     }
 
     private double getWeight(Graph graph, Weighting w, int from, int to, boolean incoming) {
@@ -400,7 +400,7 @@ public class PrepareContractionHierarchiesTest {
     }
 
     private EdgeIteratorState getEdge(Graph graph, int from, int to, boolean incoming) {
-        EdgeFilter filter = incoming ? DefaultEdgeFilter.inEdges(carEncoder.getAccessEnc()) : DefaultEdgeFilter.outEdges(carEncoder.getAccessEnc());
+        EdgeFilter filter = incoming ? AccessFilter.inEdges(carEncoder.getAccessEnc()) : AccessFilter.outEdges(carEncoder.getAccessEnc());
         EdgeIterator iter = graph.createEdgeExplorer(filter).setBaseNode(from);
         while (iter.next()) {
             if (iter.getAdjNode() == to) {
@@ -411,7 +411,7 @@ public class PrepareContractionHierarchiesTest {
     }
 
     private CHEdgeIteratorState getEdge(CHGraph graph, int from, int to, boolean incoming) {
-        EdgeFilter filter = incoming ? DefaultEdgeFilter.inEdges(carEncoder.getAccessEnc()) : DefaultEdgeFilter.outEdges(carEncoder.getAccessEnc());
+        EdgeFilter filter = incoming ? AccessFilter.inEdges(carEncoder.getAccessEnc()) : AccessFilter.outEdges(carEncoder.getAccessEnc());
         CHEdgeIterator iter = graph.createEdgeExplorer(filter).setBaseNode(from);
         while (iter.next()) {
             if (iter.getAdjNode() == to) {
@@ -563,7 +563,7 @@ public class PrepareContractionHierarchiesTest {
         }
         long timeMotorCycle = sw.getMillis();
 
-        assertTrue("reusing node ordering should speed up ch contraction", timeMotorCycle < 0.5 * timeCar);
+        assertTrue(timeMotorCycle < 0.5 * timeCar, "reusing node ordering should speed up ch contraction");
     }
 
     private void checkPath(GraphHopperStorage g, CHConfig c, int expShortcuts, double expDistance, IntIndexedContainer expNodes, int[] nodeOrdering) {
@@ -571,11 +571,11 @@ public class PrepareContractionHierarchiesTest {
         PrepareContractionHierarchies prepare = createPrepareContractionHierarchies(g, c);
         useNodeOrdering(prepare, nodeOrdering);
         prepare.doWork();
-        assertEquals(c.toString(), expShortcuts, prepare.getShortcuts());
+        assertEquals(expShortcuts, prepare.getShortcuts(), c.toString());
         RoutingAlgorithm algo = new CHRoutingAlgorithmFactory(lg).createAlgo(new PMap());
         Path path = algo.calcPath(3, 12);
-        assertEquals(path.toString(), expDistance, path.getDistance(), 1e-5);
-        assertEquals(path.toString(), expNodes, path.calcNodes());
+        assertEquals(expDistance, path.getDistance(), 1e-5, path.toString());
+        assertEquals(expNodes, path.calcNodes(), path.toString());
     }
 
     private PrepareContractionHierarchies createPrepareContractionHierarchies(GraphHopperStorage g) {
diff --git a/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java b/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java
index 64a442164..d78828bf3 100644
--- a/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java
+++ b/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java
@@ -23,7 +23,7 @@ import com.graphhopper.RepeatRule;
 import com.graphhopper.routing.Dijkstra;
 import com.graphhopper.routing.Path;
 import com.graphhopper.routing.util.CarFlagEncoder;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.TraversalMode;
 import com.graphhopper.routing.weighting.*;
@@ -33,25 +33,15 @@ import com.graphhopper.storage.GraphHopperStorage;
 import com.graphhopper.storage.RAMDirectory;
 import com.graphhopper.util.EdgeIterator;
 import com.graphhopper.util.GHUtility;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.RepeatedTest;
 
-import java.util.Random;
+import static org.junit.jupiter.api.Assertions.*;
 
-import static org.junit.Assert.assertEquals;
+import java.util.Random;
 
 public class LMApproximatorTest {
 
-    @Rule
-    public RepeatRule repeatRule = new RepeatRule();
-
-    @Before
-    public void init() {
-    }
-
-    @Test
-    @Repeat(times = 5)
+    @RepeatedTest(value = 10)
     public void randomGraph() {
         final long seed = System.nanoTime();
         run(seed);
@@ -120,7 +110,7 @@ public class LMApproximatorTest {
                     // That's a requirement for normal A*-implementations, because if it is violated,
                     // the heap-weight of settled nodes can decrease, and that would mean our
                     // stopping criterion is not sufficient.
-                    EdgeIterator neighbors = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc())).setBaseNode(v);
+                    EdgeIterator neighbors = graph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc())).setBaseNode(v);
                     while (neighbors.next()) {
                         int w = neighbors.getAdjNode();
                         double vw = weighting.calcEdgeWeight(neighbors, false);
@@ -131,7 +121,7 @@ public class LMApproximatorTest {
                         }
                     }
 
-                    neighbors = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc())).setBaseNode(v);
+                    neighbors = graph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc())).setBaseNode(v);
                     while (neighbors.next()) {
                         int w = neighbors.getAdjNode();
                         double vw = weighting.calcEdgeWeight(neighbors, false);
@@ -168,8 +158,8 @@ public class LMApproximatorTest {
 
             }
 
-            assertEquals("too many over approximated weights, seed: " + seed, 0, nOverApproximatedWeights);
-            assertEquals("too many inconsistent weights, seed: " + seed, 0, nInconsistentWeights);
+            assertEquals(0, nOverApproximatedWeights, "too many over approximated weights, seed: " + seed);
+            assertEquals(0, nInconsistentWeights, "too many inconsistent weights, seed: " + seed);
         }
     }
 
diff --git a/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java b/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java
index d8285c0df..272c4a941 100644
--- a/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java
+++ b/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java
@@ -435,8 +435,8 @@ public class QueryGraphTest {
 
     @Test
     public void testIteration_Issue163() {
-        EdgeFilter outEdgeFilter = DefaultEdgeFilter.outEdges(encodingManager.getEncoder("car").getAccessEnc());
-        EdgeFilter inEdgeFilter = DefaultEdgeFilter.inEdges(encodingManager.getEncoder("car").getAccessEnc());
+        EdgeFilter outEdgeFilter = AccessFilter.outEdges(encodingManager.getEncoder("car").getAccessEnc());
+        EdgeFilter inEdgeFilter = AccessFilter.inEdges(encodingManager.getEncoder("car").getAccessEnc());
         EdgeExplorer inExplorer = g.createEdgeExplorer(inEdgeFilter);
         EdgeExplorer outExplorer = g.createEdgeExplorer(outEdgeFilter);
 
@@ -719,7 +719,7 @@ public class QueryGraphTest {
 
         LocationIndexTree locationIndex = new LocationIndexTree(g, new RAMDirectory());
         locationIndex.prepareIndex();
-        Snap snap = locationIndex.findClosest(0.15, 0.15, DefaultEdgeFilter.allEdges(encoder.getAccessEnc()));
+        Snap snap = locationIndex.findClosest(0.15, 0.15, AccessFilter.allEdges(encoder.getAccessEnc()));
         assertTrue(snap.isValid());
         assertEquals(EDGE, snap.getSnappedPosition(), "this test was supposed to test the Position.EDGE case");
         QueryGraph queryGraph = lookup(snap);
@@ -761,7 +761,7 @@ public class QueryGraphTest {
 
         LocationIndexTree locationIndex = new LocationIndexTree(g, new RAMDirectory());
         locationIndex.prepareIndex();
-        Snap snap = locationIndex.findClosest(0.2, 0.21, DefaultEdgeFilter.allEdges(encoder.getAccessEnc()));
+        Snap snap = locationIndex.findClosest(0.2, 0.21, AccessFilter.allEdges(encoder.getAccessEnc()));
         assertTrue(snap.isValid());
         assertEquals(PILLAR, snap.getSnappedPosition(), "this test was supposed to test the Position.PILLAR case");
         QueryGraph queryGraph = lookup(snap);
diff --git a/core/src/test/java/com/graphhopper/routing/subnetwork/EdgeBasedTarjanSCCTest.java b/core/src/test/java/com/graphhopper/routing/subnetwork/EdgeBasedTarjanSCCTest.java
index 0f3c059d2..314380acc 100644
--- a/core/src/test/java/com/graphhopper/routing/subnetwork/EdgeBasedTarjanSCCTest.java
+++ b/core/src/test/java/com/graphhopper/routing/subnetwork/EdgeBasedTarjanSCCTest.java
@@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 class EdgeBasedTarjanSCCTest {
     private final FlagEncoder encoder = new CarFlagEncoder(5, 5, 1);
     private final EncodingManager em = EncodingManager.create(encoder);
-    private final EdgeFilter edgeFilter = DefaultEdgeFilter.outEdges(encoder.getAccessEnc());
+    private final EdgeFilter edgeFilter = AccessFilter.outEdges(encoder.getAccessEnc());
 
     @Test
     public void linearSingle() {
diff --git a/core/src/test/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworksTest.java b/core/src/test/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworksTest.java
index 011466380..4696b7b7e 100644
--- a/core/src/test/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworksTest.java
+++ b/core/src/test/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworksTest.java
@@ -20,7 +20,6 @@ package com.graphhopper.routing.subnetwork;
 import com.graphhopper.routing.ev.BooleanEncodedValue;
 import com.graphhopper.routing.util.*;
 import com.graphhopper.routing.weighting.DefaultTurnCostProvider;
-import com.graphhopper.routing.weighting.TurnCostProvider;
 import com.graphhopper.storage.GraphBuilder;
 import com.graphhopper.storage.GraphHopperStorage;
 import com.graphhopper.util.EdgeExplorer;
@@ -79,7 +78,7 @@ public class PrepareRoutingSubnetworksTest {
         instance.setMinNetworkSize(4);
         instance.doWork();
         assertTrue(GHUtility.getProblems(g).isEmpty());
-        EdgeExplorer explorer = g.createEdgeExplorer(DefaultEdgeFilter.allEdges(encoder.getAccessEnc()));
+        EdgeExplorer explorer = g.createEdgeExplorer(AccessFilter.allEdges(encoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(), GHUtility.getNeighbors(explorer.setBaseNode(4)));
 
         // this time we lower the threshold and the small network will remain
@@ -88,7 +87,7 @@ public class PrepareRoutingSubnetworksTest {
                 new PrepareRoutingSubnetworks.PrepareJob("car", accessEnc, NO_TURN_COST_PROVIDER)));
         instance.setMinNetworkSize(3);
         instance.doWork();
-        explorer = g.createEdgeExplorer(DefaultEdgeFilter.allEdges(encoder.getAccessEnc()));
+        explorer = g.createEdgeExplorer(AccessFilter.allEdges(encoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(5, 6), GHUtility.getNeighbors(explorer.setBaseNode(4)));
     }
 
@@ -103,7 +102,7 @@ public class PrepareRoutingSubnetworksTest {
         instance.setMinNetworkSize(4);
         instance.doWork();
         assertTrue(GHUtility.getProblems(g).isEmpty());
-        EdgeExplorer explorer = g.createEdgeExplorer(DefaultEdgeFilter.allEdges(encoder.getAccessEnc()));
+        EdgeExplorer explorer = g.createEdgeExplorer(AccessFilter.allEdges(encoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(), GHUtility.getNeighbors(explorer.setBaseNode(4)));
 
         // this time we lower the threshold and the small network will remain
@@ -112,7 +111,7 @@ public class PrepareRoutingSubnetworksTest {
                 new PrepareRoutingSubnetworks.PrepareJob("car", accessEnc, NO_TURN_COST_PROVIDER)));
         instance.setMinNetworkSize(3);
         instance.doWork();
-        explorer = g.createEdgeExplorer(DefaultEdgeFilter.allEdges(encoder.getAccessEnc()));
+        explorer = g.createEdgeExplorer(AccessFilter.allEdges(encoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(5, 6), GHUtility.getNeighbors(explorer.setBaseNode(4)));
     }
 
@@ -170,9 +169,9 @@ public class PrepareRoutingSubnetworksTest {
         instance.setMinNetworkSize(5);
         instance.doWork();
 
-        EdgeExplorer carExplorer = g.createEdgeExplorer(DefaultEdgeFilter.allEdges(carEncoder.getAccessEnc()));
+        EdgeExplorer carExplorer = g.createEdgeExplorer(AccessFilter.allEdges(carEncoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(7, 2, 1), GHUtility.getNeighbors(carExplorer.setBaseNode(3)));
-        EdgeExplorer bikeExplorer = g.createEdgeExplorer(DefaultEdgeFilter.allEdges(((FlagEncoder) bikeEncoder).getAccessEnc()));
+        EdgeExplorer bikeExplorer = g.createEdgeExplorer(AccessFilter.allEdges(((FlagEncoder) bikeEncoder).getAccessEnc()));
         assertEquals(GHUtility.asSet(7, 2, 1, 4), GHUtility.getNeighbors(bikeExplorer.setBaseNode(3)));
 
         // now we block the edge for both vehicles, in which case the smaller subnetwork gets removed
diff --git a/core/src/test/java/com/graphhopper/routing/subnetwork/TarjanSCCTest.java b/core/src/test/java/com/graphhopper/routing/subnetwork/TarjanSCCTest.java
index 20aaa1c90..19d92e466 100644
--- a/core/src/test/java/com/graphhopper/routing/subnetwork/TarjanSCCTest.java
+++ b/core/src/test/java/com/graphhopper/routing/subnetwork/TarjanSCCTest.java
@@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 class TarjanSCCTest {
     private final FlagEncoder encoder = new CarFlagEncoder();
     private final EncodingManager em = EncodingManager.create(encoder);
-    private final EdgeFilter edgeFilter = DefaultEdgeFilter.outEdges(encoder.getAccessEnc());
+    private final EdgeFilter edgeFilter = AccessFilter.outEdges(encoder.getAccessEnc());
 
     @Test
     public void testFindComponents() {
diff --git a/core/src/test/java/com/graphhopper/routing/util/DefaultEdgeFilterTest.java b/core/src/test/java/com/graphhopper/routing/util/AccessFilterTest.java
similarity index 85%
rename from core/src/test/java/com/graphhopper/routing/util/DefaultEdgeFilterTest.java
rename to core/src/test/java/com/graphhopper/routing/util/AccessFilterTest.java
index 196d3fb24..ad67e25f5 100644
--- a/core/src/test/java/com/graphhopper/routing/util/DefaultEdgeFilterTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/AccessFilterTest.java
@@ -26,11 +26,12 @@ import com.graphhopper.storage.GraphHopperStorage;
 import com.graphhopper.util.CHEdgeExplorer;
 import com.graphhopper.util.CHEdgeIterator;
 import com.graphhopper.util.GHUtility;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-public class DefaultEdgeFilterTest {
+public class AccessFilterTest {
     private final CarFlagEncoder encoder = new CarFlagEncoder();
     private final EncodingManager encodingManager = EncodingManager.create(encoder);
     private final GraphHopperStorage graph = new GraphBuilder(encodingManager)
@@ -50,8 +51,8 @@ public class DefaultEdgeFilterTest {
         graph.freeze();
         // add loop shortcut in 'fwd' direction
         addShortcut(chGraph, 0, 0, true, 0, 2);
-        CHEdgeExplorer outExplorer = chGraph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc()));
-        CHEdgeExplorer inExplorer = chGraph.createEdgeExplorer(DefaultEdgeFilter.inEdges(encoder.getAccessEnc()));
+        CHEdgeExplorer outExplorer = chGraph.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc()));
+        CHEdgeExplorer inExplorer = chGraph.createEdgeExplorer(AccessFilter.inEdges(encoder.getAccessEnc()));
 
         IntSet inEdges = new IntHashSet();
         IntSet outEdges = new IntHashSet();
@@ -64,8 +65,8 @@ public class DefaultEdgeFilterTest {
             inEdges.add(inIter.getEdge());
         }
         // the loop should be accepted by in- and outExplorers
-        assertEquals("Wrong outgoing edges", IntHashSet.from(0, 3), outEdges);
-        assertEquals("Wrong incoming edges", IntHashSet.from(2, 3), inEdges);
+        assertEquals(IntHashSet.from(0, 3), outEdges, "Wrong outgoing edges");
+        assertEquals(IntHashSet.from(2, 3), inEdges, "Wrong incoming edges");
     }
 
     private void addShortcut(CHGraph chGraph, int from, int to, boolean fwd, int skip1, int skip2) {
diff --git a/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
index 04df84797..d963cbf97 100644
--- a/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
@@ -25,13 +25,13 @@ import com.graphhopper.storage.Graph;
 import com.graphhopper.storage.GraphBuilder;
 import com.graphhopper.storage.IntsRef;
 import com.graphhopper.util.*;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 import java.text.DateFormat;
 import java.util.Date;
 
-import static org.junit.Assert.*;
-
 /**
  * @author Peter Karich
  */
@@ -92,7 +92,7 @@ public class FootFlagEncoderTest {
         g.edge(0, 1).setDistance(10).set(footAvgSpeedEnc, 10.0).set(footAccessEnc, true, true);
         g.edge(0, 2).setDistance(10).set(footAvgSpeedEnc, 5.0).set(footAccessEnc, true, true);
         g.edge(1, 3).setDistance(10).set(footAvgSpeedEnc, 10.0).set(footAccessEnc, true, true);
-        EdgeExplorer out = g.createEdgeExplorer(DefaultEdgeFilter.outEdges(footEncoder.getAccessEnc()));
+        EdgeExplorer out = g.createEdgeExplorer(AccessFilter.outEdges(footEncoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(1, 2), GHUtility.getNeighbors(out.setBaseNode(0)));
         assertEquals(GHUtility.asSet(0, 3), GHUtility.getNeighbors(out.setBaseNode(1)));
         assertEquals(GHUtility.asSet(0), GHUtility.getNeighbors(out.setBaseNode(2)));
@@ -343,13 +343,13 @@ public class FootFlagEncoderTest {
         ReaderNode node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
         // no barrier!
-        assertTrue(footEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, footEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
         node.setTag("access", "yes");
         // no barrier!
-        assertTrue(footEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, footEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
@@ -366,7 +366,7 @@ public class FootFlagEncoderTest {
         node.setTag("access", "no");
         node.setTag("foot", "yes");
         // no barrier!
-        assertTrue(footEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, footEncoder.handleNodeTags(node));
 
         node.setTag("locked", "yes");
         // barrier!
@@ -378,7 +378,7 @@ public class FootFlagEncoderTest {
         // by default allow access through the gate for bike & foot!
         ReaderNode node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "chain");
-        assertTrue(footEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, footEncoder.handleNodeTags(node));
         node.setTag("foot", "no");
         assertTrue(footEncoder.handleNodeTags(node) > 0);
     }
@@ -388,12 +388,12 @@ public class FootFlagEncoderTest {
         // by default do not block access due to fords!
         ReaderNode node = new ReaderNode(1, -1, -1);
         node.setTag("ford", "no");
-        assertTrue(footEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, footEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("ford", "yes");
         // no barrier!
-        assertTrue(footEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, footEncoder.handleNodeTags(node));
 
         // barrier!
         node.setTag("foot", "no");
@@ -403,7 +403,7 @@ public class FootFlagEncoderTest {
         EncodingManager.create(tmpEncoder);
         node = new ReaderNode(1, -1, -1);
         node.setTag("ford", "no");
-        assertTrue(tmpEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, tmpEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("ford", "yes");
@@ -418,7 +418,7 @@ public class FootFlagEncoderTest {
         ReaderNode node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
         // potential barriers are no barrier by default
-        assertTrue(tmpFootEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, tmpFootEncoder.handleNodeTags(node));
         node.setTag("access", "no");
         assertTrue(tmpFootEncoder.handleNodeTags(node) > 0);
 
@@ -437,7 +437,7 @@ public class FootFlagEncoderTest {
         node.setTag("barrier", "gate");
         assertTrue(tmpFootEncoder.handleNodeTags(node) > 0);
         node.setTag("access", "yes");
-        assertTrue(tmpFootEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, tmpFootEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "fence");
@@ -448,6 +448,6 @@ public class FootFlagEncoderTest {
         EncodingManager.create(tmpFootEncoder);
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "cattle_grid");
-        assertTrue(tmpFootEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, tmpFootEncoder.handleNodeTags(node));
     }
 }
diff --git a/core/src/test/java/com/graphhopper/routing/util/WheelchairFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/WheelchairFlagEncoderTest.java
index 625da61bd..03cca1ca1 100644
--- a/core/src/test/java/com/graphhopper/routing/util/WheelchairFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/WheelchairFlagEncoderTest.java
@@ -23,12 +23,12 @@ import com.graphhopper.routing.ev.BooleanEncodedValue;
 import com.graphhopper.routing.ev.DecimalEncodedValue;
 import com.graphhopper.storage.*;
 import com.graphhopper.util.*;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.text.DateFormat;
 import java.util.Date;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * @author don-philipe
@@ -79,7 +79,7 @@ public class WheelchairFlagEncoderTest {
         g.edge(0, 1).setDistance(10).set(wheelchairAvSpeedEnc, 10.0).set(wheelchairAccessEnc, true, true);
         g.edge(0, 2).setDistance(10).set(wheelchairAvSpeedEnc, 5.0).set(wheelchairAccessEnc, true, true);
         g.edge(1, 3).setDistance(10).set(wheelchairAvSpeedEnc, 10.0).set(wheelchairAccessEnc, true, true);
-        EdgeExplorer out = g.createEdgeExplorer(DefaultEdgeFilter.outEdges(wheelchairEncoder.getAccessEnc()));
+        EdgeExplorer out = g.createEdgeExplorer(AccessFilter.outEdges(wheelchairEncoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(1, 2), GHUtility.getNeighbors(out.setBaseNode(0)));
         assertEquals(GHUtility.asSet(0, 3), GHUtility.getNeighbors(out.setBaseNode(1)));
         assertEquals(GHUtility.asSet(0), GHUtility.getNeighbors(out.setBaseNode(2)));
@@ -361,13 +361,13 @@ public class WheelchairFlagEncoderTest {
         ReaderNode node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
         // no barrier!
-        assertTrue(wheelchairEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, wheelchairEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
         node.setTag("access", "yes");
         // no barrier!
-        assertTrue(wheelchairEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, wheelchairEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
@@ -384,7 +384,7 @@ public class WheelchairFlagEncoderTest {
         node.setTag("access", "no");
         node.setTag("foot", "yes");
         // no barrier!
-        assertTrue(wheelchairEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, wheelchairEncoder.handleNodeTags(node));
 
         node.setTag("locked", "yes");
         // barrier!
@@ -399,7 +399,7 @@ public class WheelchairFlagEncoderTest {
         ReaderNode node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "gate");
         // potential barriers are no barrier by default
-        assertTrue(tmpWheelchairEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, tmpWheelchairEncoder.handleNodeTags(node));
         node.setTag("access", "no");
         assertTrue(tmpWheelchairEncoder.handleNodeTags(node) > 0);
 
@@ -424,13 +424,13 @@ public class WheelchairFlagEncoderTest {
         node.setTag("barrier", "gate");
         assertTrue(tmpWheelchairEncoder.handleNodeTags(node) > 0);
         node.setTag("access", "yes");
-        assertTrue(tmpWheelchairEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, tmpWheelchairEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "kerb");
         assertTrue(tmpWheelchairEncoder.handleNodeTags(node) > 0);
         node.setTag("wheelchair", "yes");
-        assertTrue(tmpWheelchairEncoder.handleNodeTags(node) == 0);
+        assertEquals(0, tmpWheelchairEncoder.handleNodeTags(node));
 
         node = new ReaderNode(1, -1, -1);
         node.setTag("barrier", "fence");
diff --git a/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java b/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java
index 5c42dafc5..589ac56eb 100644
--- a/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java
+++ b/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java
@@ -22,9 +22,9 @@ import com.graphhopper.routing.ev.DecimalEncodedValue;
 import com.graphhopper.routing.util.*;
 import com.graphhopper.util.*;
 import com.graphhopper.util.shapes.BBox;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.Closeable;
 import java.io.File;
@@ -33,7 +33,7 @@ import java.util.List;
 
 import static com.graphhopper.routing.util.EncodingManager.getKey;
 import static com.graphhopper.util.GHUtility.count;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Abstract test class to be extended for implementations of the Graph interface. Graphs
@@ -52,14 +52,14 @@ public abstract class AbstractGraphStorageTester {
     protected DecimalEncodedValue carAvSpeedEnc = carEncoder.getAverageSpeedEnc();
     protected FootFlagEncoder footEncoder = (FootFlagEncoder) encodingManager.getEncoder("foot");
     protected GraphHopperStorage graph;
-    EdgeFilter carOutFilter = DefaultEdgeFilter.outEdges(carEncoder.getAccessEnc());
-    EdgeFilter carInFilter = DefaultEdgeFilter.inEdges(carEncoder.getAccessEnc());
+    EdgeFilter carOutFilter = AccessFilter.outEdges(carEncoder.getAccessEnc());
+    EdgeFilter carInFilter = AccessFilter.inEdges(carEncoder.getAccessEnc());
     EdgeExplorer carOutExplorer;
     EdgeExplorer carInExplorer;
     EdgeExplorer carAllExplorer;
 
     public static void assertPList(PointList expected, PointList list) {
-        assertEquals("size of point lists is not equal", expected.getSize(), list.getSize());
+        assertEquals(expected.getSize(), list.getSize(), "size of point lists is not equal");
         for (int i = 0; i < expected.getSize(); i++) {
             assertEquals(expected.getLat(i), list.getLat(i), 1e-4);
             assertEquals(expected.getLon(i), list.getLon(i), 1e-4);
@@ -102,12 +102,12 @@ public abstract class AbstractGraphStorageTester {
 
     abstract GraphHopperStorage createGHStorage(String location, boolean is3D);
 
-    @Before
+    @BeforeEach
     public void setUp() {
         Helper.removeDir(new File(locationParent));
     }
 
-    @After
+    @AfterEach
     public void tearDown() {
         Helper.close(graph);
         Helper.removeDir(new File(locationParent));
@@ -653,7 +653,7 @@ public abstract class AbstractGraphStorageTester {
         EdgeIteratorState edge = graph.edge(0, 3).setDistance(10);
         GHUtility.setSpeed(10, true, true, footEncoder, edge);
         GHUtility.setSpeed(10, true, true, carEncoder, edge);
-        EdgeExplorer footOutExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(footEncoder.getAccessEnc()));
+        EdgeExplorer footOutExplorer = graph.createEdgeExplorer(AccessFilter.outEdges(footEncoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(3, 1), GHUtility.getNeighbors(footOutExplorer.setBaseNode(0)));
         assertEquals(GHUtility.asSet(3, 2), GHUtility.getNeighbors(carOutExplorer.setBaseNode(0)));
     }
@@ -694,8 +694,8 @@ public abstract class AbstractGraphStorageTester {
         EdgeIteratorState iter2 = GHUtility.setSpeed(60, true, true, carEncoder, graph.edge(0, 1).setDistance(10));
         iter2.setName("named street2");
 
-        assertEquals("named street1", graph.getEdgeIteratorState(iter1.getEdge(), iter1.getAdjNode()).getName());
-        assertEquals("named street2", graph.getEdgeIteratorState(iter2.getEdge(), iter2.getAdjNode()).getName());
+        assertEquals(graph.getEdgeIteratorState(iter1.getEdge(), iter1.getAdjNode()).getName(), "named street1");
+        assertEquals(graph.getEdgeIteratorState(iter2.getEdge(), iter2.getAdjNode()).getName(), "named street2");
     }
 
     @Test
diff --git a/core/src/test/java/com/graphhopper/storage/GraphEdgeIdFinderTest.java b/core/src/test/java/com/graphhopper/storage/GraphEdgeIdFinderTest.java
index dbf1c6317..3007d5c80 100644
--- a/core/src/test/java/com/graphhopper/storage/GraphEdgeIdFinderTest.java
+++ b/core/src/test/java/com/graphhopper/storage/GraphEdgeIdFinderTest.java
@@ -21,14 +21,14 @@ import com.graphhopper.routing.util.*;
 import com.graphhopper.storage.index.LocationIndex;
 import com.graphhopper.storage.index.LocationIndexTree;
 import com.graphhopper.util.GHUtility;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 import java.util.Set;
 import java.util.TreeSet;
 
 import static com.graphhopper.util.GHUtility.updateDistancesFor;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 
 /**
  * @author Peter Karich
@@ -58,12 +58,12 @@ public class GraphEdgeIdFinderTest {
                 .prepareIndex();
 
         GraphEdgeIdFinder graphFinder = new GraphEdgeIdFinder(graph, locationIndex);
-        GraphEdgeIdFinder.BlockArea blockArea = graphFinder.parseBlockArea("0.01,0.005,1", DefaultEdgeFilter.allEdges(encoder.getAccessEnc()), 1000 * 1000);
+        GraphEdgeIdFinder.BlockArea blockArea = graphFinder.parseBlockArea("0.01,0.005,1", AccessFilter.allEdges(encoder.getAccessEnc()), 1000 * 1000);
         assertEquals("[0]", blockArea.toString(0));
 
         // big area => no edgeIds are collected up-front
         graphFinder = new GraphEdgeIdFinder(graph, locationIndex);
-        blockArea = graphFinder.parseBlockArea("0,0,1000", DefaultEdgeFilter.allEdges(encoder.getAccessEnc()), 1000 * 1000);
+        blockArea = graphFinder.parseBlockArea("0,0,1000", AccessFilter.allEdges(encoder.getAccessEnc()), 1000 * 1000);
         assertFalse(blockArea.hasCachedEdgeIds(0));
     }
 
@@ -111,16 +111,16 @@ public class GraphEdgeIdFinderTest {
         GraphEdgeIdFinder graphFinder = new GraphEdgeIdFinder(graph, locationIndex);
         // big value => the polygon is small => force edgeId optimization
         double area = 500_000L * 500_000L;
-        GraphEdgeIdFinder.BlockArea blockArea = graphFinder.parseBlockArea("2.1,1, -1.1,2, 2,3", DefaultEdgeFilter.allEdges(encoder.getAccessEnc()), area);
+        GraphEdgeIdFinder.BlockArea blockArea = graphFinder.parseBlockArea("2.1,1, -1.1,2, 2,3", AccessFilter.allEdges(encoder.getAccessEnc()), area);
         assertEquals("[1, 2, 6, 7, 11, 12]", blockArea.toString(0));
         assertEdges(graph, "[1, 2, 6, 7, 11, 12]", blockArea);
 
         // small value => same polygon is now "large" => do not pre-calculate edgeId set => check only geometries
-        blockArea = graphFinder.parseBlockArea("2.1,1, 0.9,3, 0.9,2, -0.3,0", DefaultEdgeFilter.allEdges(encoder.getAccessEnc()), 1000 * 1000);
+        blockArea = graphFinder.parseBlockArea("2.1,1, 0.9,3, 0.9,2, -0.3,0", AccessFilter.allEdges(encoder.getAccessEnc()), 1000 * 1000);
         assertFalse(blockArea.hasCachedEdgeIds(0));
         assertEdges(graph, "[0, 1, 4, 5, 6, 7, 9, 10]", blockArea);
 
-        blockArea = graphFinder.parseBlockArea("1.5,3,100000", DefaultEdgeFilter.allEdges(encoder.getAccessEnc()), area);
+        blockArea = graphFinder.parseBlockArea("1.5,3,100000", AccessFilter.allEdges(encoder.getAccessEnc()), area);
         assertEquals("[2, 7]", blockArea.toString(0));
         assertEdges(graph, "[2, 7]", blockArea);
     }
diff --git a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageCHTest.java b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageCHTest.java
index ce2bd33ad..26210dfb9 100644
--- a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageCHTest.java
+++ b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageCHTest.java
@@ -28,7 +28,7 @@ import com.graphhopper.util.EdgeExplorer;
 import com.graphhopper.util.EdgeIteratorState;
 import com.graphhopper.util.GHUtility;
 import com.graphhopper.util.shapes.BBox;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.util.Arrays;
@@ -36,7 +36,7 @@ import java.util.List;
 
 import static com.graphhopper.routing.ch.NodeBasedNodeContractorTest.SC_ACCESS;
 import static com.graphhopper.util.EdgeIterator.NO_EDGE;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * @author Peter Karich
@@ -73,18 +73,18 @@ public class GraphHopperStorageCHTest extends GraphHopperStorageTest {
         return graph;
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     @Override
     public void testClone() {
         // todo: implement graph copying in the presence of turn costs
-        super.testClone();
+        assertThrows(IllegalArgumentException.class, super::testClone);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     @Override
     public void testCopyTo() {
         // todo: implement graph copying in the presence of turn costs
-        super.testCopyTo();
+        assertThrows(IllegalArgumentException.class, super::testCopyTo);
     }
 
     @Test
@@ -303,7 +303,7 @@ public class GraphHopperStorageCHTest extends GraphHopperStorageTest {
         setIdentityLevels(lg);
         lg.shortcut(1, 4, PrepareEncoder.getScFwdDir(), 3, NO_EDGE, NO_EDGE);
 
-        EdgeExplorer vehicleOutExplorer = lg.createEdgeExplorer(DefaultEdgeFilter.outEdges(carEncoder.getAccessEnc()));
+        EdgeExplorer vehicleOutExplorer = lg.createEdgeExplorer(AccessFilter.outEdges(carEncoder.getAccessEnc()));
         // iteration should result in same nodes even if reusing the iterator
         assertEquals(GHUtility.asSet(3, 4), GHUtility.getNeighbors(vehicleOutExplorer.setBaseNode(1)));
         assertEquals(GHUtility.asSet(3, 4), GHUtility.getNeighbors(vehicleOutExplorer.setBaseNode(1)));
@@ -350,13 +350,13 @@ public class GraphHopperStorageCHTest extends GraphHopperStorageTest {
         assertEquals(edge2.getEdge(), iter.getSkippedEdge2());
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testAddShortcut_edgeBased_throwsIfNotConfiguredForEdgeBased() {
         graph = newGHStorage(false, false);
         GHUtility.setSpeed(60, true, false, carEncoder, graph.edge(0, 1).setDistance(1));
         GHUtility.setSpeed(60, true, false, carEncoder, graph.edge(1, 2).setDistance(1));
         graph.freeze();
-        addShortcut(getGraph(graph), 0, 2, true, 0, 1, 0, 1, 2);
+        assertThrows(IllegalStateException.class, () -> addShortcut(getGraph(graph), 0, 2, true, 0, 1, 0, 1, 2));
     }
 
     @Test
@@ -467,14 +467,14 @@ public class GraphHopperStorageCHTest extends GraphHopperStorageTest {
         }
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testLoadingWithWrongWeighting_node_throws() {
-        testLoadingWithWrongWeighting_throws(false);
+        assertThrows(IllegalStateException.class, () -> testLoadingWithWrongWeighting_throws(false));
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testLoadingWithWrongWeighting_edge_throws() {
-        testLoadingWithWrongWeighting_throws(true);
+        assertThrows(IllegalStateException.class, () -> testLoadingWithWrongWeighting_throws(true));
     }
 
     private void testLoadingWithWrongWeighting_throws(boolean edgeBased) {
@@ -489,7 +489,7 @@ public class GraphHopperStorageCHTest extends GraphHopperStorageTest {
         newGHStorage.loadExisting();
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testLoadingWithExtraWeighting_throws() {
         // we start with one profile
         GraphHopperStorage ghStorage = createStorageWithWeightings("p|car|fastest|node");
@@ -498,7 +498,7 @@ public class GraphHopperStorageCHTest extends GraphHopperStorageTest {
 
         // but then add an additional profile and try to load the graph from disk -> error
         GraphHopperStorage newGHStorage = createStorageWithWeightings("p|car|fastest|node", "q|car|shortest|node");
-        newGHStorage.loadExisting();
+        assertThrows(IllegalStateException.class, newGHStorage::loadExisting);
     }
 
     @Test
@@ -591,7 +591,7 @@ public class GraphHopperStorageCHTest extends GraphHopperStorageTest {
                         .create();
                 fail("creating multiple profiles with the same name should be an error");
             } catch (Exception e) {
-                assertTrue("unexpected error: " + e.getMessage(), e.getMessage().contains("a CHGraph already exists"));
+                assertTrue(e.getMessage().contains("a CHGraph already exists"), "unexpected error: " + e.getMessage());
             }
         }
         // ... but using multiple profiles with different names is fine even when their properties/weighting are the same
diff --git a/core/src/test/java/com/graphhopper/storage/index/LocationIndexTreeTest.java b/core/src/test/java/com/graphhopper/storage/index/LocationIndexTreeTest.java
index 020fe6e09..7bbe8f7e8 100644
--- a/core/src/test/java/com/graphhopper/storage/index/LocationIndexTreeTest.java
+++ b/core/src/test/java/com/graphhopper/storage/index/LocationIndexTreeTest.java
@@ -382,12 +382,12 @@ public class LocationIndexTreeTest {
         index.prepareIndex();
         index.setMaxRegionSearch(8);
 
-        EdgeFilter carFilter = DefaultEdgeFilter.allEdges(carEncoder.getAccessEnc());
+        EdgeFilter carFilter = AccessFilter.allEdges(carEncoder.getAccessEnc());
         Snap snap = index.findClosest(0.03, 0.03, carFilter);
         assertTrue(snap.isValid());
         assertEquals(33, snap.getClosestNode());
 
-        EdgeFilter bikeFilter = DefaultEdgeFilter.allEdges(bikeEncoder.getAccessEnc());
+        EdgeFilter bikeFilter = AccessFilter.allEdges(bikeEncoder.getAccessEnc());
         snap = index.findClosest(0.03, 0.03, bikeFilter);
         assertTrue(snap.isValid());
         assertEquals(2, snap.getClosestNode());
@@ -620,7 +620,7 @@ public class LocationIndexTreeTest {
 
         idx = (LocationIndexTree) createIndexNoPrepare(g, 500000).prepareIndex();
         FootFlagEncoder footEncoder = (FootFlagEncoder) encodingManager.getEncoder("foot");
-        assertEquals(2, idx.findClosest(1, -1, DefaultEdgeFilter.allEdges(footEncoder.getAccessEnc())).getClosestNode());
+        assertEquals(2, idx.findClosest(1, -1, AccessFilter.allEdges(footEncoder.getAccessEnc())).getClosestNode());
         Helper.close((Closeable) g);
     }
 }
diff --git a/core/src/test/java/com/graphhopper/util/CHEdgeIteratorTest.java b/core/src/test/java/com/graphhopper/util/CHEdgeIteratorTest.java
index a33959844..775ac8335 100644
--- a/core/src/test/java/com/graphhopper/util/CHEdgeIteratorTest.java
+++ b/core/src/test/java/com/graphhopper/util/CHEdgeIteratorTest.java
@@ -20,7 +20,7 @@ package com.graphhopper.util;
 import com.graphhopper.routing.ev.BooleanEncodedValue;
 import com.graphhopper.routing.ev.DecimalEncodedValue;
 import com.graphhopper.routing.util.CarFlagEncoder;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EdgeFilter;
 import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.weighting.FastestWeighting;
@@ -28,9 +28,9 @@ import com.graphhopper.storage.CHConfig;
 import com.graphhopper.storage.CHGraph;
 import com.graphhopper.storage.GraphBuilder;
 import com.graphhopper.storage.GraphHopperStorage;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * @author Peter Karich
@@ -41,7 +41,7 @@ public class CHEdgeIteratorTest {
         CarFlagEncoder carFlagEncoder = new CarFlagEncoder();
         EncodingManager encodingManager = EncodingManager.create(carFlagEncoder);
         FastestWeighting weighting = new FastestWeighting(carFlagEncoder);
-        EdgeFilter carOutFilter = DefaultEdgeFilter.outEdges(carFlagEncoder.getAccessEnc());
+        EdgeFilter carOutFilter = AccessFilter.outEdges(carFlagEncoder.getAccessEnc());
         GraphHopperStorage g = new GraphBuilder(encodingManager).setCHConfigs(CHConfig.nodeBased("p", weighting)).create();
         BooleanEncodedValue accessEnc = carFlagEncoder.getAccessEnc();
         DecimalEncodedValue avSpeedEnc = carFlagEncoder.getAverageSpeedEnc();
diff --git a/core/src/test/java/com/graphhopper/util/DepthFirstSearchTest.java b/core/src/test/java/com/graphhopper/util/DepthFirstSearchTest.java
index a51c6527f..fb4a548b7 100644
--- a/core/src/test/java/com/graphhopper/util/DepthFirstSearchTest.java
+++ b/core/src/test/java/com/graphhopper/util/DepthFirstSearchTest.java
@@ -21,16 +21,15 @@ import com.carrotsearch.hppc.IntArrayList;
 import com.graphhopper.coll.GHBitSet;
 import com.graphhopper.coll.GHBitSetImpl;
 import com.graphhopper.coll.GHIntHashSet;
-import com.graphhopper.routing.util.DefaultEdgeFilter;
+import com.graphhopper.routing.util.AccessFilter;
 import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.FlagEncoder;
 import com.graphhopper.storage.Graph;
 import com.graphhopper.storage.GraphBuilder;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * @author jansoe
@@ -41,7 +40,7 @@ public class DepthFirstSearchTest {
     GHIntHashSet set = new GHIntHashSet();
     IntArrayList list = new IntArrayList();
 
-    @Before
+    @BeforeEach
     public void setup() {
         counter = 0;
     }
@@ -57,7 +56,7 @@ public class DepthFirstSearchTest {
             @Override
             public boolean goFurther(int v) {
                 counter++;
-                assertTrue("v " + v + " is already contained in set. iteration:" + counter, !set.contains(v));
+                assertTrue(!set.contains(v), "v " + v + " is already contained in set. iteration:" + counter);
                 set.add(v);
                 list.add(v);
                 return super.goFurther(v);
@@ -75,10 +74,10 @@ public class DepthFirstSearchTest {
         GHUtility.setSpeed(60, true, false, encoder, g.edge(5, 6).setDistance(1));
         GHUtility.setSpeed(60, true, false, encoder, g.edge(6, 4).setDistance(1));
 
-        dfs.start(g.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc())), 1);
+        dfs.start(g.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc())), 1);
 
         assertTrue(counter > 0);
-        assertEquals("[1, 2, 3, 4, 5, 6]", list.toString());
+        assertEquals(list.toString(), "[1, 2, 3, 4, 5, 6]");
     }
 
     @Test
@@ -92,7 +91,7 @@ public class DepthFirstSearchTest {
             @Override
             public boolean goFurther(int v) {
                 counter++;
-                assertTrue("v " + v + " is already contained in set. iteration:" + counter, !set.contains(v));
+                assertTrue(!set.contains(v), "v " + v + " is already contained in set. iteration:" + counter);
                 set.add(v);
                 list.add(v);
                 return super.goFurther(v);
@@ -108,10 +107,10 @@ public class DepthFirstSearchTest {
         GHUtility.setSpeed(60, true, false, encoder, g.edge(2, 3).setDistance(1));
         GHUtility.setSpeed(60, true, true, encoder, g.edge(4, 3).setDistance(1));
 
-        dfs.start(g.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder.getAccessEnc())), 1);
+        dfs.start(g.createEdgeExplorer(AccessFilter.outEdges(encoder.getAccessEnc())), 1);
 
         assertTrue(counter > 0);
-        assertEquals("[1, 2, 3, 4]", list.toString());
+        assertEquals(list.toString(), "[1, 2, 3, 4]");
     }
 
 }
diff --git a/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java b/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
index 599a43095..5c8a8a069 100644
--- a/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
+++ b/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
@@ -308,7 +308,7 @@ public class OSMReaderTest {
         assertEquals(GHUtility.asSet(n10, n30, n40), GHUtility.getNeighbors(carAllExplorer.setBaseNode(n20)));
         assertEquals(GHUtility.asSet(n30, n40), GHUtility.getNeighbors(carOutExplorer.setBaseNode(n20)));
 
-        EdgeExplorer footOutExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(footEncoder.getAccessEnc()));
+        EdgeExplorer footOutExplorer = graph.createEdgeExplorer(AccessFilter.outEdges(footEncoder.getAccessEnc()));
         assertEquals(GHUtility.asSet(n20, n50), GHUtility.getNeighbors(footOutExplorer.setBaseNode(n10)));
         assertEquals(GHUtility.asSet(n20, n50), GHUtility.getNeighbors(footOutExplorer.setBaseNode(n30)));
         assertEquals(GHUtility.asSet(n10, n30), GHUtility.getNeighbors(footOutExplorer.setBaseNode(n20)));
@@ -956,8 +956,8 @@ public class OSMReaderTest {
             setGraphHopperStorage(tmpGraph);
             super.importOSM();
             carAccessEnc = carEncoder.getAccessEnc();
-            carOutExplorer = getGraphHopperStorage().createEdgeExplorer(DefaultEdgeFilter.outEdges(carAccessEnc));
-            carAllExplorer = getGraphHopperStorage().createEdgeExplorer(DefaultEdgeFilter.allEdges(carAccessEnc));
+            carOutExplorer = getGraphHopperStorage().createEdgeExplorer(AccessFilter.outEdges(carAccessEnc));
+            carAllExplorer = getGraphHopperStorage().createEdgeExplorer(AccessFilter.allEdges(carAccessEnc));
         }
 
         @Override