Here are some lines of code that need to convert into Java.
val geojsonSeq = for (kml <- kmlSeq) yield kmlConverter.toGeoJson(kml)
I tried to convert using for each loop in java using lamda operator but not able to get it.
kmlSeq.foreach((Function1<Option<Kml>, U>) (f) -> {
});
Every time I am getting compile-time error like: "The method foreach(Function1<Option,U>) is ambiguous for the type Seq<Option>"
Apart from this if I'm going to use normally for each loop in java like :
for(Option<Kml> kml : kmlSeq)
{
}
In that case kmlSeq is throwing error like : "Can only iterate over an array or an instance of java.lang.Iterable" But in scala the kmlSeq looping into Option object.