void () { final LinkedHashMap<Integer, String> tested = new LinkedHashMap<>(); for (int i = 0; i < 1000; ++i) { tested.put(i, Integer.toString(i)); } assertEquals(1000, tested.size()); for (int i = 0; i < 1000; ++i) { assertEquals(Integer.toString(i), tested.get(i)); } for (int i = 0; i < 1000; ++i) { assertEquals(Integer.toString(i), tested.put(i, Integer.toString(i + 1))); } assertEquals(1000, tested.size()); for (int i = 0; i < 1000; ++i) { assertEquals(Integer.toString(i + 1), tested.get(i)); } }