Buggy code:
public class JsonTest extends AndroidTestCase { public static String TEST_CASE_STRING = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "{" + ( ( ( ( "\"emptyArray\":[]," + "\"nonEmptyArray\":[{\"contents\":<seq2seq4repair_space>1},<seq2seq4repair_space>2,<seq2seq4repair_space>false,<seq2seq4repair_space>null,<seq2seq4repair_space>\"string\",<seq2seq4repair_space>[]]," ) + "\"string\":<seq2seq4repair_space>\"I<seq2seq4repair_space>am<seq2seq4repair_space>a<seq2seq4repair_space>string\"," ) + "\"numbers\":[-2e0,<seq2seq4repair_space>-1.000,<seq2seq4repair_space>0e10,<seq2seq4repair_space>10e-1,<seq2seq4repair_space>2]," ) + "\"bigNumber\":<seq2seq4repair_space>" ) ) + ( Integer . MAX_VALUE ) ) + "," ) + "\"null\":<seq2seq4repair_space>null," ) + "\"boolean\":<seq2seq4repair_space>false," ) + "\"emptyObject\":<seq2seq4repair_space>{}," ) + "\"notObject\":<seq2seq4repair_space>1," ) + "\"nonEmptyObject\":<seq2seq4repair_space>{\"contents\":1}," ) + "\"testObject\":<seq2seq4repair_space>{" ) + "\"number\":1," ) + "\"string\":\"string\"," ) + "\"bool\":\"true\"," ) + "\"null\":null," ) + "\"array\":[]," ) + "\"object\":{}" ) + "}" ) + "}" ; protected Json testJson = Json . fromString ( JsonTest . TEST_CASE_STRING ) ; private Json EMPTY_ARRAY ; private Json NULL ; private Json EMPTY_OBJECT ; private Json OBJECT_A1_B2 ; private Json ONE ; private Json STRING ; private Json STRING_TRUE ; private Json STRING_NULL ; private Json STRING_ONE_POINT_FIVE ; private Json DIFFERENT_STRING ; private Json TRUE ; private Json FALSE ; private Json NON_EMPTY_ARRAY ; public void setUp ( ) { } public void testNull ( ) throws Throwable { } public void testBoolean ( ) throws Throwable { } public void testNumber ( ) throws Throwable { } public void testString ( ) throws Throwable { } public void testArray ( ) throws Throwable { } public void testObject ( ) throws Throwable { } public void testHas ( ) throws Throwable { } public void testHasNull ( ) throws Throwable { } public void testHasBoolean ( ) throws Throwable { } public void testHasLong ( ) throws Throwable { } public void testHasDouble ( ) throws Throwable { } public void testHasString ( ) throws Throwable { } public void testHasArray ( ) throws Throwable { } public void testHasObject ( ) throws Throwable { } public void testGet ( ) throws Throwable { } public void testGetBoolean ( ) throws Throwable { } public void testGetLong ( ) throws Throwable { } public void testGetDouble ( ) throws Throwable { } public void testGetString ( ) throws Throwable { } public void testGetArray ( ) throws Throwable { Json testObject = Json . fromString ( "{\"string\":<seq2seq4repair_space>\"memimo\",<seq2seq4repair_space>\"array\":<seq2seq4repair_space>[]}" ) ; Assert . assertNotNull ( testObject . getArray ( "array" ) ) ; Assert . assertEquals ( EMPTY_ARRAY , testObject . getArray ( "array" , ( ( Jarray ) ( NON_EMPTY_ARRAY ) ) ) ) ; Assert . assertNotSame ( EMPTY_ARRAY , testObject . getArray ( "whatever" , ( ( Jarray ) ( NON_EMPTY_ARRAY ) ) ) ) ; try { <START_BUG> testObject . getArray ( "array" ) ; <END_BUG> Assert . fail ( ) ; } catch ( Exception e ) { Assert . assertEquals ( e . getMessage ( ) , NOT_ARRAY ) ; } try { testObject . getArray ( "whatever" ) ; Assert . fail ( ) ; } catch ( Exception e ) { Assert . assertEquals ( e . getClass ( ) , NullPointerException . class ) ; } Json testArray = Json . fromString ( "[\"memimo\",<seq2seq4repair_space>[]]" ) ; Assert . assertNotNull ( testArray . getArray ( 1 ) ) ; try { testObject . getArray ( 0 ) ; Assert . fail ( ) ; } catch ( Exception e ) { Assert . assertEquals ( e . getMessage ( ) , NOT_ARRAY ) ; } try { testObject . getArray ( 2 ) ; Assert . fail ( ) ; } catch ( Exception e ) { Assert . assertEquals ( e . getClass ( ) , IndexOutOfBoundsException . class ) ; } try { testObject . getArray ( "whatever" ) ; Assert . fail ( ) ; } catch ( Exception e ) { Assert . assertEquals ( e . getClass ( ) , NullPointerException . class ) ; } try { STRING . getArray ( 1 ) ; Assert . fail ( ) ; } catch ( Exception e ) { Assert . assertEquals ( e . getMessage ( ) , NOT_ARRAY ) ; } try { STRING . getArray ( "whatever" ) ; Assert . fail ( ) ; } catch ( Exception e ) { Assert . assertEquals ( e . getMessage ( ) , NOT_OBJECT ) ; } } public void testGetObject ( ) throws Throwable { } public void testIsEmpty ( ) throws Throwable { } public void testAdd ( ) throws Throwable { } public void testPut ( ) throws Throwable { } public void testIterator ( ) throws Throwable { } public void testKeys ( ) throws Throwable { } public void testUpdate ( ) throws Throwable { } public void testLength ( ) throws Throwable { } public void testIsNull ( ) throws Throwable { } public void testIsBoolean ( ) throws Throwable { } public void testIsNumber ( ) throws Throwable { } public void testIsDouble ( ) throws Throwable { } public void testIsLong ( ) throws Throwable { } public void testIsString ( ) throws Throwable { } public void testIsArray ( ) throws Throwable { } public void testIsObject ( ) throws Throwable { } public void testToString ( ) throws Throwable { } public void testNewArray ( ) throws Throwable { } public void testNewObject ( ) throws Throwable { } }

Fix:
testObject . getArray ( "string" ) ;