// Path: src/main/java/io/aif/language/common/IDictBuilder.java
// public interface IDictBuilder<T, R> {
// 
//   public IDict<R> build(final T tokens);
// 
// }
// 
// Path: src/main/java/io/aif/language/common/IGrouper.java
// public interface IGrouper {
// 
//   public List<Set<String>> group(final Collection<String> tokens);
// }
// 
// Path: src/main/java/io/aif/language/word/IWord.java
// public interface IWord {
// 
//   public String getRootToken();
// 
//   public Set<String> getAllTokens();
// 
//   public Long getCount();
// 
//   public int getTokenCount(String token);
// 
//   public static interface IWordPlaceholder {
// 
//     public IWord getWord();
// 
//     public String getToken();
// 
//   }
// 
// }


import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import io.aif.language.common.IDict;
import io.aif.language.common.IDictBuilder;
import io.aif.language.common.IGrouper;
import io.aif.language.word.IWord;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
package io.aif.language.word.dict;





public class DictBuilderTest {

  @Test(groups = "unit-tests")
  public void testConstructorWithoutArguments() throws Exception {
    try {
      new DictBuilder();
      assert true;
    } catch (Exception e) {
      assert false;
    }
  }

  @Test(groups = "unit-tests")
  public void testBuild() throws Exception {
    List<String> input = Arrays.asList("hey", "heya", "hiya");
    Set<String> tokens = new HashSet<>(input);
    List<Set<String>> grouperReturn = Arrays.asList(tokens);
    IWord mockIWord = new Word("hey", tokens, (long) tokens.size());
    List<IWord> wordMapperReturn = Arrays.asList(mockIWord);

    IDict expected = Dict.create(new HashSet<>(Arrays.asList(mockIWord)));

    IGrouper grouperMock = mock(IGrouper.class);
    WordMapper wordMapperMock = mock(WordMapper.class);

    when(grouperMock.group(any())).thenReturn(grouperReturn);
    when(wordMapperMock.mapAll(any())).thenReturn(wordMapperReturn);

// Path: src/main/java/io/aif/language/common/IDictBuilder.java
// public interface IDictBuilder<T, R> {
// 
//   public IDict<R> build(final T tokens);
// 
// }
// 
// Path: src/main/java/io/aif/language/common/IGrouper.java
// public interface IGrouper {
// 
//   public List<Set<String>> group(final Collection<String> tokens);
// }
// 
// Path: src/main/java/io/aif/language/word/IWord.java
// public interface IWord {
// 
//   public String getRootToken();
// 
//   public Set<String> getAllTokens();
// 
//   public Long getCount();
// 
//   public int getTokenCount(String token);
// 
//   public static interface IWordPlaceholder {
// 
//     public IWord getWord();
// 
//     public String getToken();
// 
//   }
// 
// }


// Path: src/test/unit/java/io/aif/language/word/dict/DictBuilderTest.java
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import io.aif.language.common.IDict;
import io.aif.language.common.IDictBuilder;
import io.aif.language.common.IGrouper;
import io.aif.language.word.IWord;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;

package io.aif.language.word.dict;





public class DictBuilderTest {

  @Test(groups = "unit-tests")
  public void testConstructorWithoutArguments() throws Exception {
    try {
      new DictBuilder();
      assert true;
    } catch (Exception e) {
      assert false;
    }
  }

  @Test(groups = "unit-tests")
  public void testBuild() throws Exception {
    List<String> input = Arrays.asList("hey", "heya", "hiya");
    Set<String> tokens = new HashSet<>(input);
    List<Set<String>> grouperReturn = Arrays.asList(tokens);
    IWord mockIWord = new Word("hey", tokens, (long) tokens.size());
    List<IWord> wordMapperReturn = Arrays.asList(mockIWord);

    IDict expected = Dict.create(new HashSet<>(Arrays.asList(mockIWord)));

    IGrouper grouperMock = mock(IGrouper.class);
    WordMapper wordMapperMock = mock(WordMapper.class);

    when(grouperMock.group(any())).thenReturn(grouperReturn);
    when(wordMapperMock.mapAll(any())).thenReturn(wordMapperReturn);

    IDictBuilder builder = new DictBuilder(grouperMock, wordMapperMock);