StringThing[] st = new StringThing[NUM_ELTS];
for (int i = 0; i < NUM_ELTS; i++) {
st[i] = new StringThing();
keyCopies[i] = st[i].getId();
}
// android.os.Debug.startMethodTracing();
long start = SystemClock.uptimeMillis();
for (int i = 0; i < ITERS; i++) {
HashMap<String, StringThing> map = new HashMap<String, StringThing>();
for (int j = 0; j < NUM_ELTS; j++) {
StringThing s = st[i];
map.put(s.getId(), s);
}
for (int j = 0; j < NUM_ELTS; j++) {
if (lookupByOriginals) {
StringThing s = st[i];
map.get(s.getId());
} else {
map.get(keyCopies[j]);
}
}
}
long finish = SystemClock.uptimeMillis();
// android.os.Debug.stopMethodTracing();
// This should be an assertion instead
// System.out.println("time (" + NUM_ELTS +
// ", elts, " + ITERS +
// " iters) = " + (finish - start));