I’m currently working within a java runtime google cloud dataflow. The scala sdk I'm using shows the property I'm working with as an immutable list: https://github.com/snowplow/snowplow-scala-analytics-sdk/blob/master/src/main/scala/com.snowplowanalytics.snowplow.analytics.scalasdk/Event.scala#L91
final List<SelfDescribingData> contexts
Does anyone have any pointers on how to properly cast / convert this to a Java list? Most of the examples I have found are doing this in the Scala runtime vs the Java runtime.
I had thought the JavaConverters package would help me here, however these methods don't seem to be expecting an immutable scala list.
Where e in the example below is an instance of the Event in the linked sdk.
List<SelfDescribingData<Json>> list = JavaConverters.asScalaBufferConverter(e.contexts()).asScala().toList();
for (SelfDescribingData<Json> t : list) {
LOG.info(t.toString());
}