package ru.spbau.twiktor;

public class TwitterRTFilter {
    private String textTwitter;

    public TwitterRTFilter(String newText) {
        if (newText == null || newText.isEmpty())
        {
            throw new NullPointerException("newText");
        }

        textTwitter = newText;
    }

    public String filter()
    {
        if (textTwitter.startsWith("RT"))
        {
            textTwitter = textTwitter.replaceAll("^RT ?@[A-Za-z0-9]+:?", "");
            textTwitter = textTwitter.substring(1);
        }

        return textTwitter;
    }
}

@@ -330,64 +330,8 @@
   %7B%0A
-        if (textTwitter.startsWith(%22RT%22))%0A        %7B%0A    
     
@@ -376,9 +376,8 @@
 ll(%22
-%5E
 RT ?
@@ -395,28 +395,24 @@
 %5D+:?%22, %22%22);%0A
-    
         text
@@ -437,31 +437,37 @@
 ter.
-substring(1);%0A        %7D
+trim().replaceAll(%22 +%22, %22 %22);
 %0A%0A  

Fix TwitterRTFilter