Skip to content
Advertisement

Tag: transform

incompatible types: no instance(s) of type variable(s) F,T exist so that java.util.Collection conforms to java.util.Set<java.lang.Long

I am trying to convert the list of ComplexItem to a list of their corresponding IDs Long. But getting the above error which doesn’t go even after typecasting the getCollection() call with (Collection<ComplexItem>) Answer There’s no reason to expect that the result of Collections2.transform, which is a Collection, will be magically transformed to a Set. This is the reason for

Advertisement