I am making a simple unit tester, where i iterate on pairs of (input, expected)
values, and check if a calculated actual
value equals the expected
.
This is perfectly doable in a simple HashMap<INPUTTYPE, OUTPUTTYPE>
, but hash logic is pointless, since i'm going to iterate on all values, and never search in the map, while it would be nice to keep the order of the test cases (pairs of (input, expected)
).
A List<Entry<K,V>>
seems to work well, but it seems not nice to use an inner component of a Map in a List. It also seems unnatural to create the Pair class to connect input and expected, since Entry is the same thing.
Is there a way using existing java classes in the base libs that support this kind of data very well?