Correct use of Option in scala?
You could write it like this:

for (val method &lt;- clazz.getMethods) {
  val methodAndAnnotation = method.getAnnotation(annotationType) match {
    case annotation: MessageHandler =&gt; Some((method, annotation))
    case _                          =&gt; getMethodAndAnnotationFromInterfaces(clazz.getInterfaces, method, annotationType)
  }

  methodAndAnnotation match {
    case Some((method, annotation)) =&gt; // do something
    case None =&gt; //whatever is relevant
  }
}


Or shorter:

for (val method &lt;- clazz.getMethods) {
  method.getAnnotation(annotationType) match {
    case annotation: MessageHandler =&gt;  // do something with method and annotation
    case _                          =&gt; {
      val v = getMethodAndAnnotationFromInterfaces(clazz.getInterfaces, method, annotationType)
      //whatever is relevant
    }
  }
}


But it depends on what you want to do / if you have something to do when getMethodAndAnnotationFromInterfaces returns None.