SuperKoTable implements Serializable { public boolean contains(long key) { if (key == EMPTY) { return true; } int slot = ((int) key & IGNORE_SIGN_BIT) % data.length; while (data[slot] != EMPTY) { if (data[slot] == key) { return true; } slot = (slot + 1) % data.length; } return false; } SuperKoTable(CoordinateSystem coords); void add(long key); void clear(); boolean contains(long key); void copyDataFrom(SuperKoTable that); static final long EMPTY; static final int IGNORE_SIGN_BIT; }
@Test public void testZero() { assertTrue(table.contains(0)); }