replace LinkedHashMap with a more memory efficient implementation

This saves approximately 50MB of heap space.
This commit is contained in:
2017-09-30 17:50:44 +02:00
parent 7e00594382
commit d4fd25dc4c
4 changed files with 188 additions and 13 deletions

View File

@@ -0,0 +1,26 @@
package org.lucares.utils;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test;
@Test
public class MiniMapTest {
public void testInsertGet()
{
final MiniMap<String, String> map = new MiniMap<>();
String key1 = "key1";
String key2 = "key2";
String value1 = "value1";
String value2 = "value1";
map.put(key1, value1);
map.put(key2, value2);
Assert.assertEquals(map.get(key1), value1);
Assert.assertEquals(map.get(key2), value2);
}
}