add logik back to tutorial in java rewrite engine

**please review**