Added a test for IMAP APPEND

It's a preliminary change for IMAP bug fixes.

Also,
- Fixed a potential bug in ImapFolder.setFlags where it'd throw
  StringIndexOutOfBoundsException if flags is empty.

- Added a generic flag to proguard.flags so that now all methods with
  the "ForTest" sufix are automatically preserved.
  Turned out it wasn't needed for this CL, but it should come in handy
  someday.

Bug 2538076
Change-Id: I49a08afc196c7b7f1f30477dfc38ac5381045d84
diff --git a/proguard.flags b/proguard.flags
index be627db..bbffc8a 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -26,6 +26,10 @@
 
 # Keep names that are used only by unit tests
 
+-keep class ** {
+  *** *ForTest(...);
+}
+
 -keepclasseswithmembers class com.android.email.GroupMessagingListener {
   *** removeListener(com.android.email.MessagingListener);
 }
@@ -168,4 +172,3 @@
 -keep class org.apache.james.mime4j.message.Message {
   *;
 }
-