add java bfs version