Skip to content

Commit 693da95

Browse files
committed
BAEL-2536-updated Panagram to Pangram
1 parent 4eb3f29 commit 693da95

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎java-strings/src/main/java/com/baeldung/string/Pangram.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
public class Pangram {
1010
private static final int ALPHABET_COUNT = 26;
1111

12-
public static boolean isPanagram(String str) {
12+
public static boolean isPangram(String str) {
1313
if (str == null)
1414
return false;
1515
Boolean[] alphabetMarker = new Boolean[ALPHABET_COUNT];
@@ -29,10 +29,10 @@ public static boolean isPanagram(String str) {
2929
return true;
3030
}
3131

32-
public static boolean isPanagramWithStreams(String str) {
32+
public static boolean isPangramWithStreams(String str) {
3333
if (str == null)
3434
return false;
35-
35+
3636
// filtered character stream
3737
String strUpper = str.toUpperCase();
3838
Stream<Character> filteredCharStream = strUpper.chars()
@@ -43,10 +43,10 @@ public static boolean isPanagramWithStreams(String str) {
4343
return (alphabetMap.size() == ALPHABET_COUNT);
4444
}
4545

46-
public static boolean isPerfectPanagram(String str) {
46+
public static boolean isPerfectPangram(String str) {
4747
if (str == null)
4848
return false;
49-
49+
5050
// filtered character stream
5151
String strUpper = str.toUpperCase();
5252
Stream<Character> filteredCharStream = strUpper.chars()

‎java-strings/src/test/java/com/baeldung/string/PangramUnitTest.java‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@ public class PangramUnitTest {
1010
@Test
1111
public void givenValidString_isPanagram_shouldReturnSuccess() {
1212
String input = "Two driven jocks help fax my big quiz";
13-
assertTrue(Pangram.isPanagram(input));
14-
assertTrue(Pangram.isPanagramWithStreams(input));
13+
assertTrue(Pangram.isPangram(input));
14+
assertTrue(Pangram.isPangramWithStreams(input));
1515
}
1616

1717
@Test
1818
public void givenNullString_isPanagram_shouldReturnFailure() {
1919
String input = null;
20-
assertFalse(Pangram.isPanagram(input));
21-
assertFalse(Pangram.isPanagramWithStreams(input));
22-
assertFalse(Pangram.isPerfectPanagram(input));
20+
assertFalse(Pangram.isPangram(input));
21+
assertFalse(Pangram.isPangramWithStreams(input));
22+
assertFalse(Pangram.isPerfectPangram(input));
2323
}
2424

2525
@Test
2626
public void givenPerfectPanagramString_isPerfectPanagram_shouldReturnSuccess() {
2727
String input = "abcdefghijklmNoPqrStuVwxyz";
28-
assertTrue(Pangram.isPerfectPanagram(input));
28+
assertTrue(Pangram.isPerfectPangram(input));
2929
}
3030

3131
@Test
3232
public void givenNonPanagramString_isPanagram_shouldReturnFailure() {
3333
String input = "invalid panagram";
34-
assertFalse(Pangram.isPanagram(input));
35-
assertFalse(Pangram.isPanagramWithStreams(input));
34+
assertFalse(Pangram.isPangram(input));
35+
assertFalse(Pangram.isPangramWithStreams(input));
3636
}
3737

3838
@Test
3939
public void givenPanagram_isPerfectPanagram_shouldReturnFailure() {
4040
String input = "Two driven jocks help fax my big quiz";
41-
assertFalse(Pangram.isPerfectPanagram(input));
41+
assertFalse(Pangram.isPerfectPangram(input));
4242
}
4343

4444
}

0 commit comments

Comments
 (0)