import junit.framework.TestCase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.ipnb.format.IpnbFile;
import org.jetbrains.plugins.ipnb.format.IpnbParser;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class TestJsonParserTest extends TestCase {
    public void testFile() throws IOException {
        final String fileName = "testData/SymPy.ipynb";
        final BufferedReader br = new BufferedReader(new FileReader(fileName));
        try {
            final String fileText = getFileText(br);
            final IpnbFile ipnbFile = IpnbParser.parseIpnbFile(fileText);
            assertNotNull(ipnbFile);
            assertEquals(31, ipnbFile.getCells().size());
        } finally {
            br.close();
        }
    }

    private String getFileText(@NotNull final BufferedReader br) throws IOException {
        final StringBuilder sb = new StringBuilder();
        String line = br.readLine();

        while (line != null) {
            sb.append(line);
            sb.append(System.lineSeparator());
            line = br.readLine();
        }
        return sb.toString();
    }
}

@@ -311,18 +311,16 @@
 tCase %7B%0A
-  
   public
@@ -349,36 +349,32 @@
 s IOException %7B%0A
-    
     final String
@@ -409,20 +409,16 @@
 ipynb%22;%0A
-    
     fina
@@ -493,24 +493,14 @@
     
-  
-  
 try %7B%0A
-      
     
@@ -548,22 +548,16 @@
 ;%0A      
-    
-  
 final Ip
@@ -610,22 +610,16 @@
 eText);%0A
-      
       as
@@ -647,22 +647,16 @@
 ;%0A      
-    
-  
 assertEq
@@ -697,21 +697,21 @@
 ));%0A    
+%7D%0A
    
- %7D
  finally
@@ -713,22 +713,16 @@
 nally %7B%0A
-      
       br
@@ -735,27 +735,19 @@
 ();%0A
-    
     %7D%0A
-  
   %7D%0A%0A
-  
   pr
@@ -826,20 +826,16 @@
 ption %7B%0A
-    
     fina
@@ -872,28 +872,24 @@
 gBuilder();%0A
-    
     String l
@@ -914,20 +914,16 @@
 );%0A%0A    
-  
-  
 while (l
@@ -939,30 +939,24 @@
 ll) %7B%0A      
-    
-  
 sb.append(li
@@ -960,22 +960,16 @@
 (line);%0A
-      
       sb
@@ -1007,22 +1007,16 @@
 ;%0A      
-    
-  
 line = b
@@ -1033,22 +1033,14 @@
 ();%0A
-    
     %7D%0A
-    
     
@@ -1057,20 +1057,18 @@
 toString();%0A
-  
   %7D%0A%7D%0A

reformat according code style