报错:
ClassCastException: cannot assign instance of java.lang.invoke.SerializedLambda to field XXX of type scala.Function1 in instance of XXX
解决:
把
val theMethod = (input: String) => theDict.contains(input)
改为
def theMethod(input: String) = { theDict.contains(input) }