### Question:
Anagrams { public boolean checkWords(String first, String second) { boolean result = true; if (first.length() != second.length()) { result = false; } else { HashMap<Character, Integer> symbolStorage = new HashMap<>(); for (Character symbol : first.toLowerCase().toCharArray()) { Integer symbolCounter = symbolStorage.putIfAbsent(symbol, 1); if (symbolCounter != null) { symbolStorage.put(symbol, symbolCounter + 1); } } for (Character symbol : second.toLowerCase().toCharArray()) { Integer currentValue = symbolStorage.get(symbol); if (currentValue == null) { result = false; break; } if (currentValue > 1) { symbolStorage.replace(symbol, currentValue - 1); } else { symbolStorage.remove(symbol); } } } return result; }  boolean checkWords(String first, String second);  }### Answer:
@Test public void ifTwoWordsAreAnagramsThenCheckShouldReturnTrue() { Anagrams testAnagrams = new Anagrams(); Boolean result = testAnagrams.checkWords("мама", "амам"); assertThat(result, is(true)); }
@Test public void ifTwoWordsAreNotAnagramsThenCheckShouldReturnFalse() { Anagrams testAnagrams = new Anagrams(); assertThat(testAnagrams.checkWords("мама", "папа"), is(false)); }
@Test public void ifDifferentNumberOfIdenticalLettersCheckShouldReturnFalse() { Anagrams testAnagrams = new Anagrams(); assertThat(testAnagrams.checkWords("мама", "мааа"), is(false)); }
@Test public void ifFirstWordIsLongerThenSecondCheckShouldReturnFalse() { Anagrams testAnagrams = new Anagrams(); assertThat(testAnagrams.checkWords("мамаа", "мама"), is(false)); }
@Test public void ifAnagramsHasADifferentCaseCheckShouldReturnTrue() { assertThat(new Anagrams().checkWords("Мама", "мама"), is(true)); }