Class TestMap
- java.lang.Object
-
- TestMap
-
public class TestMap extends java.lang.Object
Class to unit test an arbitrary map implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description private static class
TestMap.TestEntry<K,V>
Class to hold test entries for comparison
-
Constructor Summary
Constructors Constructor and Description TestMap()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
main(java.lang.String[] args)
static <M extends Map<java.lang.Integer,java.lang.String>>
booleanTestEntrySet(java.util.function.Supplier<M> c)
Test entrySet method of arbitrary mapstatic <M extends Map<java.lang.Integer,java.lang.String>>
booleanTestGet(java.util.function.Supplier<M> c)
Test get method of arbitrary mapstatic <M extends Map<java.lang.Integer,java.lang.String>>
voidTestMap(java.lang.String s, java.util.function.Supplier<M> c)
Test methods of arbitrary mapstatic <M extends Map<java.lang.Integer,java.lang.String>>
booleanTestPut(java.util.function.Supplier<M> c)
Test get method of arbitrary mapstatic <M extends Map<java.lang.Integer,java.lang.String>>
booleanTestRemove(java.util.function.Supplier<M> c)
Test get method of arbitrary map
-
-
-
Method Detail
-
TestGet
public static <M extends Map<java.lang.Integer,java.lang.String>> boolean TestGet(java.util.function.Supplier<M> c)
Test get method of arbitrary map- Type Parameters:
M
- Specific map structure- Parameters:
c
- Supplier to create a map of specific type- Returns:
- Result of unit test
-
TestPut
public static <M extends Map<java.lang.Integer,java.lang.String>> boolean TestPut(java.util.function.Supplier<M> c)
Test get method of arbitrary map- Type Parameters:
M
- Specific map structure- Parameters:
c
- Supplier to create a map of specific type- Returns:
- Result of unit test
-
TestRemove
public static <M extends Map<java.lang.Integer,java.lang.String>> boolean TestRemove(java.util.function.Supplier<M> c)
Test get method of arbitrary map- Type Parameters:
M
- Specific map structure- Parameters:
c
- Supplier to create a map of specific type- Returns:
- Result of unit test
-
TestEntrySet
public static <M extends Map<java.lang.Integer,java.lang.String>> boolean TestEntrySet(java.util.function.Supplier<M> c)
Test entrySet method of arbitrary map- Type Parameters:
M
- Specific map structure- Parameters:
c
- Supplier to create a map of specific type- Returns:
- Result of unit test
-
TestMap
public static <M extends Map<java.lang.Integer,java.lang.String>> void TestMap(java.lang.String s, java.util.function.Supplier<M> c)
Test methods of arbitrary map- Type Parameters:
M
- Specific map structure- Parameters:
s
- Name of map data structurec
- Supplier to create a map of specific type
-
main
public static void main(java.lang.String[] args)
-
-