package com.ykushch.prjalgo2.task1;

import org.junit.Test;

import java.util.Set;
import java.util.stream.Stream;

import static java.util.stream.Collectors.toSet;
import static org.assertj.core.api.Assertions.assertThat;

public class WordBreakTest {

    @Test
    public void shouldBreakSentenceIntoWordsWhenValidInputSent() throws Exception {
        WordBreak wordBreak = new WordBreak();
        Set<String> dict = Stream.of("greedy", "this", "is", "name", "code", "test", "a").collect(toSet());

        String sentence = wordBreak.breakWord("thisisatest", dict);

        assertThat(sentence).isEqualTo("this is a test");
    }

    @Test
    public void shouldBreakSentenceRecursivelyIntoWordsWhenValidInputSent() throws Exception {
        WordBreak wordBreak = new WordBreak();
        Set<String> dict = Stream.of("greedy", "this", "is", "name", "code", "test", "a").collect(toSet());

        String sentence = wordBreak.breakWordRecursively("thisisatest", dict);

        assertThat(sentence).isEqualTo("this is a test");
    }

}
@@ -488,33 +488,32 @@
 llect(toSet());%0A
-%0A
         String s
@@ -556,33 +556,32 @@
 satest%22, dict);%0A
-%0A
         assertTh
@@ -889,17 +889,16 @@
 Set());%0A
-%0A
         
@@ -968,17 +968,16 @@
  dict);%0A
-%0A
         
@@ -1032,10 +1032,9 @@
 ;%0A    %7D%0A
-%0A
 %7D

Remove blank lines