ENH: fix allows java code sample to run continuous mode