You can use lambdas on Java 7, but it is a bit involved — you have to use something like Retrolambda.
Also you can do the same thing without lambdas. Lambdas can be easily represented via annonymous classes, however it is a lot more verbose.
final String first = data.first();
JavaRDD filteredData = data.filter(new Function() {
@Override public Boolean call(String s) {
return !s.contains(first);
}
});