Extract method in Cat.java.