Q:

Cannot resolve method 'split(java.lang. String)' when using lambda expression

I am trying to split a String array with a lambda expression.  It however tells me that the split method cannot be resolved.  I am doing this to parse a Java Spark RDD of type String to double. 
JavaRDD parsedData = data.map(s -> {
                String[] sarray = s.split(" ");
                double[] values = new double[sarray.length];
                for (int i = 0; i < sarray.length; i++) {
                    values[i] = Double.parseDouble(sarray[i]);
                }
                return Vectors.dense(values);
            });
            parsedData.cache();

A:

If, as said in a comment, data is of type Stream<Object>, this code should do the job:
JavaRDD parsedData = data.map( o -> o.toString() )
    .map( s -> 
    {
        String[] sarray = s.split( " " );
        double[] values = new double [sarray.length];
        for( int i = 0; i < sarray.length; i++ ) 
        {
            values[i] = Double.parseDouble( sarray[i] );
        }
        return Vectors.dense( values );
    });
    parsedData.cache();

