StatsContextFactory { public static StatsContext newInstance( @NonNull GazePlay gazePlay, @NonNull Stats stats ) { return StatsContextFactory.newInstance(gazePlay, stats, null); }  static StatsContext newInstance(
        @NonNull GazePlay gazePlay,
        @NonNull Stats stats
    ); static StatsContext newInstance(
        @NonNull GazePlay gazePlay,
        @NonNull Stats stats,
        CustomButton continueButton
    );  }
@Test void shouldCreateNewInstance() { StatsContext result = StatsContextFactory.newInstance(mockGazePlay, mockStats); BorderPane pane = (BorderPane) result.getRoot().getChildren().get(1); HBox box = (HBox) pane.getChildren().get(1); assertEquals(3, result.getRoot().getChildren().size()); assertEquals(4, box.getChildren().size()); }
@Test void shouldCreateNewInstanceWithContinueButton() { CustomButton button = new CustomButton("bear.jpg", 300); StatsContext result = StatsContextFactory.newInstance(mockGazePlay, mockStats, button); BorderPane pane = (BorderPane) result.getRoot().getChildren().get(1); HBox box = (HBox) pane.getChildren().get(1); assertEquals(3, result.getRoot().getChildren().size()); assertEquals(5, box.getChildren().size()); assertEquals(button, box.getChildren().get(4)); }