Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit test SparseArray using JUnit (using JVM)

Tags:

I have an implementation which is using a Integer as key in HashMap. It is already unit tested using JUnit. But I want to change it to SparseArray which is more optimised version from Android. I am not sure how will it be unit tested using JUnit. Does anyone have a better way to do this?

like image 879
Amit Avatar asked May 13 '16 11:05

Amit


1 Answers

There's an equivalent implementation of SparseArray in Support Library called SparseArrayCompat that can be used in JVM Unit Tests. Also it has more features than the native one, so you're better off using that.

like image 120
rakshakhegde Avatar answered Oct 23 '22 13:10

rakshakhegde