This is very weird. I have an array converted to a...
# announcements
p
This is very weird. I have an array converted to a
List
using
Arrays.asList(...)
coming from Java and when I compare it with a list created with
listOf()
in Kotlin: https://pl.kotl.in/cQxTchtL0 Why aren’t following the
equals
contract? Anyone experienced this before? 🤔
d
java.util.Arrays.asList(array)
creates
List<Array<String>>
here. This list has one element in it, your array.
asList
is a varags function, such a function cannot directly be called with an array in Kotlin, you'd have to use the spread operator:
java.util.Arrays.asList(*array)
. However you should just use
array.asList()
.
p
yeah, just figure it out 😅 damn spread operator
Cheers @diesieben07
Still really odd though. I’m using RxJava 1 (I know, not my choise) and the
test()
bit… it says the size is not correct
d
Which size? What exactly? 😄
p
It hits this point
But both have 2 values 😭
d
Strange indeed. Are you sure they dont change?
values
at least is an
ArrayList
so it could...
p
Yeah, I used the assertion for each item and it all works 🙃
We’ll just upgrade to coroutines hopefully 😄