Java code example to teach  basic refactoring  concepts