import org.junit.*;
import static org.junit.Assert.*;
import java.io.File;
import se.soy.gpg.GPG;

public class Decrypt extends SearchInHeap {
  @Test public void decrypt() {
    GPG.decrypt(new File(System.getProperty("test.resources") + "/test.asc")).localUser("0xF870C097").output(System.out, "println");
  }

  void theAssert(int found) {
      assertEquals("Secret not found!", 0, found);
  }
}

@@ -90,16 +90,73 @@
 gpg.GPG;
+%0Aimport java.io.PrintStream;%0Aimport java.io.OutputStream;
 %0A%0Apublic
@@ -221,24 +221,259 @@
 decrypt() %7B%0A
+    // FIXME Disable stdout temporarily since Gradles test output makes the%0A    // secret stored on the heap.%0A    PrintStream old_out = System.out;%0A    System.setOut(new PrintStream(new OutputStream() %7B public void write(int b) %7B%7D%7D));%0A
     GPG.decr
@@ -593,16 +593,44 @@
 ntln%22);%0A
+    System.setOut(old_out);%0A
   %7D%0A%0A  v

Disable the output stream on decryotion