Avoid one liner if's unless it is if/else used for ternary operator.  In this case, do 

    if (methods.length < 1) {
      throw new QueryExecutionException("TGF " + tgfName + " needs to implement apply()")
    }