Amit Amit - 1 month ago 15
Android Question

Unit test SparseArray using JUnit (using JVM)

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?

Answer Source

Unmock is a really nice projects that gives you this and more. https://github.com/bjoernQ/unmock-plugin Just add the plugin and it will work