void () { ProgressIndicatorEx progressIndicator = new ProgressIndicatorBase(); progressIndicator.start(); progressIndicator.setText("Progress 0/2"); // attach ProgressIndicatorEx progressIndicatorWatcher1 = new ProgressIndicatorBase(); ProgressIndicatorEx progressIndicatorGroup = new ProgressIndicatorBase(); progressIndicatorGroup.addStateDelegate(progressIndicatorWatcher1); progressIndicator.addStateDelegate(progressIndicatorGroup); assertEquals(progressIndicator.getText(), progressIndicatorGroup.getText()); assertEquals(progressIndicator.getText(), progressIndicatorWatcher1.getText()); progressIndicator.setText("Progress 1/2"); // attach ProgressIndicatorEx progressIndicatorWatcher2 = new ProgressIndicatorBase(); progressIndicatorGroup.addStateDelegate(progressIndicatorWatcher2); assertEquals(progressIndicator.getText(), progressIndicatorGroup.getText()); assertEquals(progressIndicator.getText(), progressIndicatorWatcher1.getText()); assertEquals(progressIndicator.getText(), progressIndicatorWatcher2.getText()); progressIndicator.setText("Progress 2/2"); progressIndicator.stop(); assertEquals(progressIndicator.getText(), progressIndicatorGroup.getText()); assertEquals(progressIndicator.getText(), progressIndicatorWatcher1.getText()); assertEquals(progressIndicator.getText(), progressIndicatorWatcher2.getText()); }