test[map]: update tree map comment

This commit is contained in:
godotg
2023-03-26 14:22:40 +08:00
parent c4d495eab5
commit f994b974d4
2 changed files with 7 additions and 4 deletions
@@ -18,6 +18,8 @@ import com.zfoo.net.packet.common.PairIntLong;
import java.util.Arrays;
/**
* 性能更高,但是可能会浪费一定的内存
*
* @author godotg
* @version 3.0
*/
@@ -403,15 +403,16 @@ public class TreeMapTest {
@Test
public void testCelling() {
var max = 10000;
var start = 10000;
var end = 20000;
TreeMapIntLong treeMap = new TreeMapIntLong(200);
for (int i = 0; i < max; i++) {
for (int i = start; i < end; i++) {
if (i % 2 == 0) {
treeMap.put(i, i);
}
}
for (int i = 0; i < max; i++) {
if (i % 2 != 0 && i != (max - 1)) {
for (int i = start; i < end; i++) {
if (i % 2 != 0 && i != (end - 1)) {
Assert.assertEquals(treeMap.ceilingEntry(i).getValue(), i + 1);
}
if (i % 2 != 0) {