Skip to content

Instantly share code, notes, and snippets.

@rommansabbir
Last active April 28, 2021 08:56
Show Gist options
  • Save rommansabbir/38ffbdda9ce1758cb004f3d7a2e95372 to your computer and use it in GitHub Desktop.
Save rommansabbir/38ffbdda9ce1758cb004f3d7a2e95372 to your computer and use it in GitHub Desktop.
Simply check if two list is the exact same or not.
fun <T> MutableList<out T>.contentDeepEquals(
other: MutableList<out T>
): Boolean {
return Gson().toJson(this).toString() == Gson().toJson(other).toString()
}
@goforbg
Copy link

goforbg commented Apr 28, 2021

Handy little extension, I have some thing similar for objects as well 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment