}
public void testValidity()
throws Exception
{
final LinkedMap map = new LinkedMap(16, 1024);
map.put("1", "A");
map.put("2", "B");
map.put("3", "C");
map.put("4", "D");
map.put("5", "E");
map.put("6", "F");
map.put("1", "A");
final Object[] expectedKeys = {"2", "3", "4", "5", "6", "1"};
final Object[] a2 = map.keys();
if (Arrays.equals(expectedKeys, a2) == false)
{
throw new Exception();
}
if (ObjectUtilities.equal(map.get("1"), "A") == false)
{
throw new NullPointerException();
}
if (ObjectUtilities.equal(map.get("2"), "B") == false)
{
throw new NullPointerException();
}
if (ObjectUtilities.equal(map.get("3"), "C") == false)
{
throw new NullPointerException();
}
if (ObjectUtilities.equal(map.get("4"), "D") == false)
{
throw new NullPointerException();
}
if (ObjectUtilities.equal(map.get("5"), "E") == false)
{
throw new NullPointerException();
}
if (ObjectUtilities.equal(map.get("6"), "F") == false)
{
throw new NullPointerException();
}
if (ObjectUtilities.equal(map.get("1"), "A") == false)
{
throw new NullPointerException();
}
map.remove("1");
map.remove("2");
final Object[] expectedKeys2 = {"3", "4", "5", "6"};
final Object[] a3 = map.keys();
if (Arrays.equals(expectedKeys2, a3) == false)
{
throw new Exception();
}
map.remove("5");
Object[] arrayCache = map.values(new String[map.size()]);
map.remove("3");
map.remove("6");
map.remove("4");
if (map.keys().length != 0)
{
throw new Exception();
}
}