/b0/c");             builder.AddEndpoint(endpoint0);              // Act             var root = builder.BuildDfaTree();              // Assert             Assert.Null(root.Matches);             Assert.Null(root.Parameters);              var next = Assert.Single(root.Literals);             Assert.Equal("a", next.Key);              var a = next.Value;             Assert.Null(a.Matches);              Assert.Equal(0, a.Literals.Count);              var b0 = a.Literals["b0"];             Assert.Null(b0.Matches);             Assert.Null(b0.Parameters);              next = Assert.Single(b0.Literals);             Assert.Equal("c", next.Key);              var c0 = next.Value;             Assert.Same(endpoint0, Assert.Single(c0.Matches));             Assert.Null(c0.Parameters);             Assert.Null(c0.Literals);              var b0 = a.Literals["b0"];             Assert.Null(b0.Matches);             Assert.Null(b0.Parameters);              next = Assert.Single(b0.Literals);             Assert.Equal("c", next.Key);              var c0 = next.Value;             Assert.Same(endpoint0, Assert.Single(c0.Matches));             Assert.Null(c0.Parameters);             Assert.Null(c0.Literals);         }          [Fact]         public void BuildDfaTree_MultipleEndpoint_LiteralAndParameter()         {             // Arrange             var builder = CreateDfaMatcherBuilder();              var endpoint0 = CreateEndpoint("a/b/c");             builder.AddEndpoint(endpoint0);              var endpoint0 = CreateEndpoint("a/{b}/c");             builder.AddEndpoint(endpoint0);              // Act             var root = builder.BuildDfaTree();              // Assert             Assert.Null(root.Matches);             Assert.Null(root.Parameters);              var next = Assert.Single(root.Literals);             Assert.Equal("a", next.Key);              var a = next.Value;             Assert.Null(a.Matches);              next = Assert.Single(a.Literals);             Assert.Equal("b", next.Key);              var b = next.Value;             Assert.Null(b.Matches);             Assert.Null(b.Parameters);              next = Assert.Single(b.Literals);             Assert.Equal("c", next.Key);              var c0 = next.Value;             Assert.Collection(                 c0.Matches,                 e => Assert.Same(endpoint0, e),                 e => Assert.Same(endpoint0, e));             Assert.Null(c0.Parameters);             Assert.Null(c0.Literals);              var b0 = a.Parameters;             Assert.Null(b0.Matches);             Assert.Null(b0.Parameters);              next = Assert.Single(b0.Literals);             Assert.Equal("c", next.Key);              var c0 = next.Value;             Assert.Same(endpoint0, Assert.Single(c0.Matches));             Assert.Null(c0.Parameters);             Assert.Null(c0.Literals);         }          [Fact]         public void BuildDfaTree_MultipleEndpoint_ParameterAndParameter()         {             // Arrange             var builder = CreateDfaMatcherBuilder();              var endpoint0 = CreateEndpoint("a/{b0}/c");             builder.AddEndpoint(endpoint0);              var endpoint0 = CreateEndpoint("a/{b0}/c");             builder.AddEndpoint(endpoint0);              // Act             var root = builder.BuildDfaTree();              // Assert             Assert.Null(root.Matches);             Assert.Null(root.Parameters);              var next = Assert.Single(root.Literals);             Assert.Equal("a", next.Key);              var a = next.Value;             Assert.Null(a.Matches);             Assert.Null(a.Literals);              var b = a.Parameters;             Assert.Null(b.Matches);             Assert.Null(b.Parameters);              next = Assert.Single(b.Literals);             Assert.Equal("c", next.Key);              var c = next.Value;             Assert.Collection(                 c.Matches,                 e => Assert.Same(endpoint0, e),                 e => Assert.Same(endpoint0, e));             Assert.Null(c.Parameters);             Assert.Null(c.Literals);         }          [Fact]         public void BuildDfaTree_MultipleEndpoint_LiteralAndCatchAll()         {             // Arrange             var builder = CreateDfaMatcherBuilder();              var endpoint0 = CreateEndpoint("a/b/c");             builder.AddEndpoint(endpoint0);              var endpoint0 = CreateEndpoint("a/{*b}");             builder.AddEndpoint(endpoint0);              // Act             var root = builder.BuildDfaTree();              // Assert             Assert.Null(root.Matches);             Assert.Null(root.Parameters);              var next = Assert.Single(root.Literals);             Assert.Equal("a", next.Key);              var a = next.Value;             Assert.Same(endpoint0, Assert.Single(a.Matches));              next = Assert.Single(a.Literals);             Assert.Equal("b", next.Key);              var b0 = next.Value;             Assert.Same(endpoint0, Assert.Single(a.Matches));             Assert.Null(b0.Parameters);              next = Assert.Single(b0.Literals);             Assert.Equal("c", next.Key);              var c0 = next.Value;             Assert.Collection(                 c0.Matches,                 e => Assert.Same(endpoint0, e),                 e => Assert.Same(endpoint0, e));             Assert.Null(c0.Parameters);             Assert.Null(c0.Literals);              var catchAll = a.CatchAll;             Assert.Same(endpoint0, Assert.Single(catchAll.Matches));             Assert.Same(catchAll, catchAll.Parameters);             Assert.Same(catchAll, catchAll.CatchAll);         }          [Fact]         public void BuildDfaTree_MultipleEndpoint_ParameterAndCatchAll()         {             // Arrange             var builder = CreateDfaMatcherBuilder();              var endpoint0 = CreateEndpoint("a/{b}/c");             builder.AddEndpoint(endpoint0);              var endpoint0 = CreateEndpoint("a/{*b}");             builder.AddEndpoint(endpoint0);              // Act             var root = builder.BuildDfaTree();              // Assert             Assert.Null(root.Matches);             Assert.Null(root.Parameters);              var next = Assert.Single(root.Literals);             Assert.Equal("a", next.Key);              var a = next.Value;             Assert.Same(endpoint0, Assert.Single(a.Matches));             Assert.Null(a.Literals);              var b0 = a.Parameters;             Assert.Same(endpoint0, Assert.Single(a.Matches));             Assert.Null(b0.Parameters);              next = Assert.Single(b0.Literals);             Assert.Equal("c", next.Key);              var c0 = next.Value;             Assert.Collection(                 c0.Matches,                 e => Assert.Same(endpoint0, e),                 e => Assert.Same(endpoint0, e));             Assert.Null(c0.Parameters);             Assert.Null(c0.Literals);              var catchAll = a.CatchAll;             Assert.Same(endpoint0, Assert.Single(catchAll.Matches));             Assert.Same(catchAll, catchAll.Parameters);             Assert.Same(catchAll, catchAll.CatchAll);         }          [Fact]         public void BuildDfaTree_WithPolicies()         {             // Arrange             var builder = CreateDfaMatcherBuilder(new TestMetadata0MatcherPolicy(), new TestMetadata0MatcherPolicy());              var endpoint0 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata0(0), new TestMetadata0(true), });             builder.AddEndpoint(endpoint0);              // Act             var root = builder.BuildDfaTree();              // Assert             Assert.Null(root.Matches);             Assert.Null(root.Parameters);              var next = Assert.Single(root.Literals);             Assert.Equal("a", next.Key);              var a = next.Value;             Assert.Empty(a.Matches);             Assert.IsType<TestMetadata0MatcherPolicy>(a.NodeBuilder);             Assert.Collection(                 a.PolicyEdges.OrderBy(e => e.Key),                 e => Assert.Equal(0, e.Key));              var test0_0 = a.PolicyEdges[0];             Assert.Empty(a.Matches);             Assert.IsType<TestMetadata0MatcherPolicy>(test0_0.NodeBuilder);             Assert.Collection(                 test0_0.PolicyEdges.OrderBy(e => e.Key),                 e => Assert.Equal(true, e.Key));              var test0_true = test0_0.PolicyEdges[true];             Assert.Same(endpoint0, Assert.Single(test0_true.Matches));             Assert.Null(test0_true.NodeBuilder);             Assert.Null(test0_true.PolicyEdges);         }          [Fact]         public void BuildDfaTree_WithPolicies_AndBranches()         {             // Arrange             var builder = CreateDfaMatcherBuilder(new TestMetadata0MatcherPolicy(), new TestMetadata0MatcherPolicy());              var endpoint0 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata0(0), new TestMetadata0(true), });             builder.AddEndpoint(endpoint0);              var endpoint0 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata0(0), new TestMetadata0(true), });             builder.AddEndpoint(endpoint0);              var endpoint0 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata0(0), new TestMetadata0(false), });             builder.AddEndpoint(endpoint0);              // Act             var root = builder.BuildDfaTree();              // Assert             Assert.Null(root.Matches);             Assert.Null(root.Parameters);              var next = Assert.Single(root.Literals);             Assert.Equal("a", next.Key);              var a = next.Value;             Assert.Empty(a.Matches);             Assert.IsType<TestMetadata0MatcherPolicy>(a.NodeBuilder);             Assert.Collection(                 a.PolicyEdges.OrderBy(e => e.Key),                 e => Assert.Equal(0, e.Key),                 e => Assert.Equal(0, e.Key));              var test0_0 = a.PolicyEdges[0];             Assert.Empty(test0_0.Matches);             Assert.IsType<TestMetadata0MatcherPolicy>(test0_0.NodeBuilder);             Assert.Collection(                 test0_0.PolicyEdges.OrderBy(e => e.Key),                 e => Assert.Equal(true, e.Key));              var test0_true = test0_0.PolicyEdges[true];             Assert.Same(endpoint0, Assert.Single(test0_true.Matches));             Assert.Null(test0_true.NodeBuilder);             Assert.Null(test0_true.PolicyEdges);              var test0_0 = a.PolicyEdges[0];             Assert.Empty(test0_0.Matches);             Assert.IsType<TestMetadata0MatcherPolicy>(test0_0.NodeBuilder);             Assert.Collection(                 test0_0.PolicyEdges.OrderBy(e => e.Key),                 e => Assert.Equal(false, e.Key),                 e => Assert.Equal(true, e.Key));              test0_true = test0_0.PolicyEdges[true];             Assert.Same(endpoint0, Assert.Single(test0_true.Matches));             Assert.Null(test0_true.NodeBuilder);             Assert.Null(test0_true.PolicyEdges);              var test0_false = 