Added java interface into code to show that this can be run from java.