File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/test/java/software/coley/collections Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 77import java .util .List ;
88import java .util .Set ;
99
10- import static org .junit .jupiter .api .Assertions .assertEquals ;
10+ import static org .junit .jupiter .api .Assertions .* ;
1111
1212/**
1313 * Tests for {@link Tree}
@@ -146,7 +146,11 @@ public void test_tree_gets_all_leaves() {
146146 tree .putTree ("key4" , "value4" );
147147 tree .putTree ("key5" , "value5" );
148148 // There are 6 leaves, as key1 has two children
149- Set <Tree <String , String >> foo = tree .getAllLeaves ();
150- assertEquals (6 , foo .size ());
149+ Set <Tree <String , String >> leaves = tree .getAllLeaves ();
150+ assertEquals (6 , leaves .size ());
151+ // Double check parent/child relation
152+ Tree <String , String > key1a = sub1 .get ("key1-a" );
153+ assertSame (sub1 , key1a .getParent ());
154+ leaves .forEach (t -> assertNotNull (t .getParent ()));
151155 }
152156}
You can’t perform that action at this time.
0 commit comments