Question from the Java test

What "design pattern" makes it possible to offer a means of treating the elements of a tree without worrying about the course?