/**
 * Bob is a lackadasical teenager.
 */
public class Bob {
    public String hey(String input) {
        input = normalize(input);
        if (isSilence(input))
            return "Fine. Be that way!";
        if (isShout(input))
            return "Whoa, chill out!";
        if (isQuestion(input))
            return "Sure.";
        return "Whatever.";
    }

    private static String normalize(String input) {
        return input.trim();
    }

    private static boolean isSilence(String input) {
        return input.equals("");
    }

    private static boolean isShout(String input) {
        final String upperCased = input.toUpperCase();
        final String lowerCased = input.toLowerCase();
        final boolean containsSomeLetters = !lowerCased.equals(upperCased);
        final boolean isAllUpperCase = upperCased.equals(input);
        return (containsSomeLetters && isAllUpperCase);
    }

    private static boolean isQuestion(String input) {
        return input.endsWith("?");
    }
}

@@ -36,23 +36,16 @@
 er.%0A */%0A
-public 
 class Bo
@@ -56,15 +56,8 @@
     
-public 
 Stri
@@ -134,32 +134,34 @@
 sSilence(input))
+ %7B
 %0A            ret
@@ -182,24 +182,34 @@
 that way!%22;%0A
+        %7D%0A
         if (
@@ -215,32 +215,34 @@
 (isShout(input))
+ %7B
 %0A            ret
@@ -261,24 +261,34 @@
 hill out!%22;%0A
+        %7D%0A
         if (
@@ -305,16 +305,18 @@
 (input))
+ %7B
 %0A       
@@ -332,24 +332,34 @@
 rn %22Sure.%22;%0A
+        %7D%0A
         retu

improve reference solution