### Question:
SparseLongLongArray { public int binarySearch( long key ) { return binarySearch(mKeys, 0, mSize, key); } SparseLongLongArray();  SparseLongLongArray( int cap ); long get( long key ); void remove( long key ); int put( long key, long value ); int getSize(); long keyAt( int index ); void setKeyAt( int index, long key ); long valueAt( int index ); void setValueAt( int index, long value ); void clear(); int append( long key, long value ); @Override String toString(); int binarySearch( long key );  }### Answer:
@Test public void testBinarySearch() { long a[] = new long[] { 9, 53, 100 }; assertEquals(~1, SparseLongLongArray.binarySearch(a, 0, 3, 50)); assertEquals(~2, SparseLongLongArray.binarySearch(a, 0, 3, 55)); assertEquals(~3, SparseLongLongArray.binarySearch(a, 0, 3, 155)); a = new long[] { 9 }; assertEquals(~0, SparseLongLongArray.binarySearch(a, 0, 1, 5)); assertEquals(~1, SparseLongLongArray.binarySearch(a, 0, 1, 50)); }