public static void main(String[] args) {
StopWatch w = new StopWatch(1);
w.begin(true);
for (int i = 0; i < 1000; ++i) {
Map<Integer, Boolean> map = Maps.newHashMap();
Stop s = w.start();
for (int j = 0; j < 10000; ++j) {
map.put(j, j % 2 == 0);
}
for (int j = 0; j < 10000; ++j) {
Check.isTrue(map.get(j).booleanValue() == (j % 2 == 0));
}
s.stop();
}
w.done();
w.print();
// --
w.begin(true);
for (int i = 0; i < 1000; ++i) {
TIntCharMap primary = new TIntCharHashMap();
Stop s = w.start();
for (int j = 0; j < 10000; ++j) {
primary.put(j, (char)((j % 2) + '0'));
}
for (int j = 0; j < 10000; ++j) {
Check.isTrue(primary.get(j) == (char)((j % 2) + '0'));
}
s.stop();
}
w.done();
w.print();
// --
w.begin(true);
for (int i = 0; i < 1000; ++i) {
Int2CharMap int2c = new Int2CharOpenHashMap();
Stop s = w.start();
for (int j = 0; j < 10000; ++j) {
int2c.put(j, (char)((j % 2) + '0'));
}
for (int j = 0; j < 10000; ++j) {
Check.isTrue(int2c.get(j) == (char)((j % 2) + '0'));
}
s.stop();
}
w.done();
w.print();
}