Java rewrite engine

besides, something like ```isSuffix``` or ```isTail``` maybe more intuitive