@Test public void isEmpty() throws Exception { SparseArrayCompat<String> sparseArrayCompat = new SparseArrayCompat<>(); assertTrue(sparseArrayCompat.isEmpty()); for (int i = 0; i < 5; i++) { sparseArrayCompat.put(i, Integer.toString(i)); assertFalse(sparseArrayCompat.isEmpty()); } sparseArrayCompat.clear(); assertTrue(sparseArrayCompat.isEmpty()); int key1 = 1, key2 = 2; String value1 = "some value", value2 = "some other value"; sparseArrayCompat.append(key1, value1); assertFalse(sparseArrayCompat.isEmpty()); sparseArrayCompat.append(key2, value2); assertFalse(sparseArrayCompat.isEmpty()); assertFalse(sparseArrayCompat.isEmpty()); sparseArrayCompat.remove(key1); assertFalse(sparseArrayCompat.isEmpty()); sparseArrayCompat.remove(key2); assertTrue(sparseArrayCompat.isEmpty()); }
public boolean isEmpty() { return size() == 0; }
SparseArrayCompat implements Cloneable { public boolean isEmpty() { return size() == 0; } }
SparseArrayCompat implements Cloneable { public boolean isEmpty() { return size() == 0; } SparseArrayCompat();  SparseArrayCompat(int initialCapacity); }
SparseArrayCompat implements Cloneable { public boolean isEmpty() { return size() == 0; } SparseArrayCompat();  SparseArrayCompat(int initialCapacity); @Override @SuppressWarnings("unchecked") SparseArrayCompat<E> clone(); E get(int key); @SuppressWarnings("unchecked") E get(int key, E valueIfKeyNotFound); void delete(int key); void remove(int key); void removeAt(int index); void removeAtRange(int index, int size); void put(int key, E value); int size(); boolean isEmpty(); int keyAt(int index); @SuppressWarnings("unchecked") E valueAt(int index); void setValueAt(int index, E value); int indexOfKey(int key); int indexOfValue(E value); void clear(); void append(int key, E value); @Override String toString(); }
SparseArrayCompat implements Cloneable { public boolean isEmpty() { return size() == 0; } SparseArrayCompat();  SparseArrayCompat(int initialCapacity); @Override @SuppressWarnings("unchecked") SparseArrayCompat<E> clone(); E get(int key); @SuppressWarnings("unchecked") E get(int key, E valueIfKeyNotFound); void delete(int key); void remove(int key); void removeAt(int index); void removeAtRange(int index, int size); void put(int key, E value); int size(); boolean isEmpty(); int keyAt(int index); @SuppressWarnings("unchecked") E valueAt(int index); void setValueAt(int index, E value); int indexOfKey(int key); int indexOfValue(E value); void clear(); void append(int key, E value); @Override String toString();  }