Mapping words to letters which contains Given sentence for example: ala ma kota, kot koduje w Javie kota I should to every letter occurring in the sentence I should map every string that this letter contains. So the output should be: 

{a=[ala, javie, kota, ma], d=[koduje], e=[javie, koduje], i=[javie], j=[javie, koduje], k=[koduje, kot, kota], l=[ala], m=[ma], o=[koduje, kot, kota], t=[kot, kota], u=[koduje], v=[javie], w=[w]}


I have written algorithm for it, but I think that there is a better way do to this using streams (or somehow else). 
Code; 

String sentence = "ala ma kota, kot koduje w Javie kota .kota";

        String purifiedLowerCaseSentence = getPurifiedLowerCaseSentence(sentence);
        Set&lt;Character&gt; characters = getEveryCharacterOccurringInSentence(purifiedLowerCaseSentence);
        String[] splittedSentence = purifiedLowerCaseSentence.split("\\s");
        Map&lt;Character, Set&lt;String&gt;&gt; characterWithAccordingWord = new LinkedHashMap&lt;&gt;();

        for (char iteratedCharacter : characters) {
            for (String iteratedWord : splittedSentence) {
                if (iteratedWord.indexOf(iteratedCharacter) &gt;= 0) {
                    characterWithAccordingWord.computeIfAbsent(iteratedCharacter, k -&gt; new TreeSet&lt;&gt;());
                    characterWithAccordingWord.get(iteratedCharacter).add(iteratedWord);
                }
            }
        }


And these two methods which are placed in other class: 

static String getPurifiedLowerCaseSentence(String sentence) {
        return sentence.replaceAll("\\p{P}", "").toLowerCase();
    }

    static Set&lt;Character&gt; getEveryCharacterOccurringInSentence(String sentence) {
        return sentence.chars()
                .mapToObj(e -&gt; (char) e).collect(Collectors.toSet());
    }
Not sure about its efficiency or whether or not it improves your algorithm, but since you want to use streams, this would be an option:

public static void main(String[] args) {
        String sentence = "ala ma kota, kot koduje w Javie kota .kota";
        String sanitizedSentence = sentence.replaceAll("[^A-Za-z ]", "").toLowerCase();
        String[] words = sanitizedSentence.split(" ");
        Map&lt;String,List&lt;String&gt;&gt; result = sanitizedSentence
            .chars()
            .filter(Character::isAlphabetic)
            .distinct()
            .sorted()
            .mapToObj(c-&gt;(char)c)
            .map(Object::toString)
            .collect(Collectors.toMap(
                Function.identity(), 
                c-&gt;Stream.of(words).distinct().filter(word -&gt; word.contains(c)).sorted().collect(Collectors.toList()),
                (a,b)-&gt;a,
                LinkedHashMap::new // &lt;- to ensure they are shown in order when printing
            ));
        System.out.println(result);
    }