@Test
public void canStreamDescendants() throws Exception {

  JPanel panel1 = new JPanel();
  JPanel panel11 = new JPanel();
  JPanel panel12 = new JPanel();
  JPanel panel123 = new JPanel();
  JPanel panel13 = new JPanel();
  panel1.add(panel11);
  panel1.add(panel12);
  panel12.add(panel123);
  panel1.add(panel13);
  JLabel label = new JLabel();
  JButton button = new JButton();
  JTextField textField = new JTextField();
  panel11.add(label);
  panel123.add(button);
  panel13.add(textField);
  TreeWalker treeWalker = new TreeWalker(panel1);
  assertThat(treeWalker.descendantStream().filter(c -> c instanceof JLabel).findFirst().get()).isEqualTo(label);
  assertThat(treeWalker.descendantStream().filter(c -> c instanceof JButton).findFirst().get()).isEqualTo(button);
  assertThat(treeWalker.descendantStream().filter(c -> c instanceof JTextField).findFirst().get()).isEqualTo(textField);
  assertThat(treeWalker.descendantStream().anyMatch(c -> c instanceof JTable)).isFalse();
}