  @Test
  public void testRunonWords() throws IOException {

    final Speller spell = new Speller(dictionary);
    Assertions.assertThat(spell.replaceRunOnWords("abaka")).isEmpty();
    Assertions.assertThat(spell.replaceRunOnWords("abakaabace")).contains("abaka abace");
    Assertions.assertThat(spell.replaceRunOnWords("Abakaabace")).contains("Abaka abace");

    // Test on an morphological dictionary - should work as well
    final URL url1 = getClass().getResource("test-infix.dict");
    final Speller spell1 = new Speller(Dictionary.read(url1));
    assertTrue(spell1.replaceRunOnWords("Rzekunia").isEmpty());
    assertTrue(spell1.replaceRunOnWords("RzekuniaRzeczypospolitej").contains("Rzekunia Rzeczypospolitej"));
    assertTrue(spell1.replaceRunOnWords("RzekuniaRze").isEmpty()); //Rze is not found but is a prefix

    final URL url2 = getClass().getResource("single-char-word.dict");
    final Speller spell2 = new Speller(Dictionary.read(url2));
    assertTrue(spell2.replaceRunOnWords("alot").contains("a lot"));
    assertTrue(spell2.replaceRunOnWords("aalot").contains("aa lot"));
    assertTrue(spell2.replaceRunOnWords("aamusement").contains("a amusement"));
    assertTrue(spell2.replaceRunOnWords("clot").isEmpty());
    assertTrue(spell2.replaceRunOnWords("foobar").isEmpty());
  }