{
public void test(TestHarness harness)
{
InputMap m = new InputMap();
harness.check(m.allKeys(), null);
KeyStroke ks1 = KeyStroke.getKeyStroke('a');
m.put(ks1, "AAA");
KeyStroke[] keys = m.allKeys();
harness.check(keys.length, 1);
harness.check(keys[0], ks1);
InputMap p = new InputMap();
m.setParent(p);
keys = m.allKeys();
harness.check(keys.length, 1);
harness.check(keys[0], ks1);
KeyStroke ks2 = KeyStroke.getKeyStroke('b');
p.put(ks2, "BBB");
keys = m.allKeys();
harness.check(keys.length, 2);
harness.check(keys[0], ks2);
harness.check(keys[1], ks1);
// try a KeyStroke that is defined in both maps
KeyStroke ks3 = KeyStroke.getKeyStroke('z');
p.put(ks3, "ZZZ");
m.put(ks3, "XXX");
keys = m.allKeys();
harness.check(keys.length, 3);
harness.check(keys[0], ks2);