- private final Map<RpcRouter.RouteIdentifier<?, ?, ?>, Long> table = new HashMap<>();
- private ActorRef router;
+ private final Map<RouteIdentifier<?, ?, ?>, Long> table;
+ private final ActorRef router;
+
+ private RoutingTable(final ActorRef router, final Map<RouteIdentifier<?, ?, ?>, Long> table) {
+ this.router = Preconditions.checkNotNull(router);
+ this.table = Preconditions.checkNotNull(table);
+ }
+
+ RoutingTable(final ActorRef router) {
+ this(router, new HashMap<>());
+ }