branch.java from tutorials