Merge pull request #3257 from shouvikbhattacharya/BAEL-1433

BAEL-1433: Guide to TreeSet in Java
This commit is contained in:
Carsten Gräf 2017-12-18 06:50:12 +01:00 committed by GitHub
commit 617c2ffdba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -26,7 +26,6 @@ public class WhenUsingTreeSet {
@Override
public String toString() {
// TODO Auto-generated method stub
return id.toString();
}
}
@ -189,8 +188,14 @@ public class WhenUsingTreeSet {
treeSet.add(5);
treeSet.add(6);
Set<Integer> expectedSet = new TreeSet<>();
expectedSet.add(2);
expectedSet.add(3);
expectedSet.add(4);
expectedSet.add(5);
Set<Integer> subSet = treeSet.subSet(2, 6);
System.out.println(subSet);
Assert.assertEquals(expectedSet, subSet);
}
@Test