package com.mssngvwls;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class PhaseRespacerTests {

    @Mock
    private RandomNumberGenerator randomNumberGenerator;

    @InjectMocks
    private PhraseRespacer phraseRespacer;

    @Test
    public void phrase_is_respaced() {
        final String input = "Manchester United";
        when(randomNumberGenerator.between(1, 4)).thenReturn(1);
        final String expectedOutput = "M a n c h e s t e r U n i t e d";
        final String actualOutput = phraseRespacer.respace(input);
        assertThat(actualOutput).isEqualTo(expectedOutput);
    }
}

@@ -520,16 +520,36 @@
 respaced
+_with_equal_spacings
 () %7B%0A   
@@ -865,11 +865,411 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void phrase_is_respaced_with_different_spacings() %7B%0A        final String input = %22Manchester United%22;%0A        when(randomNumberGenerator.between(1, 4)).thenReturn(3, 2, 4, 3, 1, 3);%0A        final String expectedOutput = %22Man ch este rUn i ted%22;%0A        final String actualOutput = phraseRespacer.respace(input);%0A        assertThat(actualOutput).isEqualTo(expectedOutput);%0A    %7D
 %0A%7D%0A

Add respacing test with varying group sizes