public V get(long key) { if (key == NULL) { return null; } int index = find(key); if (countingAccesses) { recentlyAccessed.set(index); } return values[index]; }
@Override public V get(Object key) { if (key == null) { return null; } int index = find(key); if (countingAccesses) { recentlyAccessed.set(index); } return values[index]; }
public V get(long key) { if (key == NULL) { return null; } int index = find(key); if (countingAccesses) { recentlyAccessed.set(index); } return values[index]; }
@Override public V get(Object key) { if (key == null) { return null; } int index = find(key); if (countingAccesses) { recentlyAccessed.set(index); } return values[index]; }
public V get(long key) { if (key == NULL) { return null; } int index = find(key); if (countingAccesses) { recentlyAccessed.set(index); } return values[index]; }
@Override public V get(Object key) { if (key == null) { return null; } int index = find(key); if (countingAccesses) { recentlyAccessed.set(index); } return values[index]; }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBounds1() { BitSet bitSet = new BitSet(NUM_BITS); bitSet.set(1000); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBounds2() { BitSet bitSet = new BitSet(NUM_BITS); bitSet.set(-1); }
@Test public void testClone() { BitSet bitSet = new BitSet(NUM_BITS); bitSet.set(NUM_BITS-1); bitSet = bitSet.clone(); assertTrue(bitSet.get(NUM_BITS-1)); }
@Test public void testClear() { BitSet bitSet = new BitSet(NUM_BITS); for (int i = 0; i < NUM_BITS; i++) { bitSet.set(i); } for (int i = 0; i < NUM_BITS; i++) { assertTrue(bitSet.get(i)); } bitSet.clear(); for (int i = 0; i < NUM_BITS; i++) { assertFalse(bitSet.get(i)); } }