Kara walks straight ahead until there is a tree to his left and right. Then he continues until there no tree either to his left or right.
public void myProgram() {
while (! (kara.treeLeft() && kara.treeRight())) {
kara.move();
}
while (kara.treeLeft() && kara.treeRight()) {
kara.move();
}
}