[java/cs] Support dynamic functions in interfaces. Closes #3159