<commit_before>package com.xtremelabs.robolectric;

import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

@RunWith(WithTestDefaultsRunner.class)
public class OrgJsonTest {
    @Test
    public void testHasImplementation() throws Exception {
        assertEquals("value", new JSONObject("{'name':'value'}").getString("name"));
    }

    @Test
    public void testObject_isNull_shouldReturnTrueForNullValues() throws Exception {
        assertTrue(new JSONObject("{'name':null}").isNull("name")); // passes
    }

    @Test
    public void testObject_getString_shouldReturnNullForNullValues() throws Exception {
        assertEquals(null, new JSONObject("{'name':null}").getString("name")); // fails
    }

    @Test
    public void testObject_getJSONObject_shouldReturnNullForNullValues() throws Exception {
        assertEquals(null, new JSONObject("{'name':null}").getJSONObject("name")); // fails
    }

    @Test
    public void testObject_getInt_shouldReturnNullForNullValues() throws Exception {
        assertEquals(null, new JSONObject("{'name':null}").getInt("name")); // fails
    }

    @Test
    public void testObject_get_shouldReturnNullForNullValues() throws Exception {
        assertEquals(null, new JSONObject("{'name':null}").get("name")); // fails
    }

    @Test
    public void testObject_optString_shouldReturnNullForNullValues() throws Exception {
        assertEquals(null, new JSONObject("{'name':null}").optString("name")); // fails
    }

    @Test
    public void testObject_optInt_shouldReturnNullForNullValues() throws Exception {
        assertEquals(null, new JSONObject("{'name':null}").optInt("name")); // fails
    }

    @Test
    public void testArray_isNull_shouldReturnTrueForNullValues() throws Exception {
        assertTrue(new JSONArray("[null]").isNull(0)); // passes
    }

    @Test
    public void testArray_getString_shouldReturnNullForNullValues() throws Exception {
        assertEquals(null, new JSONArray("[null]").getString(0)); // fails
    }
}<commit_msg>Oops, shouldn't have checked those org.json tests in.<commit_after>package com.xtremelabs.robolectric;

import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

@RunWith(WithTestDefaultsRunner.class)
public class OrgJsonTest {
    @Test
    public void testHasImplementation() throws Exception {
        assertEquals("value", new JSONObject("{'name':'value'}").getString("name"));
    }
}
{'fraction_non_alphanumeric': 0.12523225566703827, 'fraction_numerical': 0.0007432181345224824, 'mean_word_length': 4.505112474437627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2973186', 'n_tokens_mistral': 749, 'n_tokens_neox': 739, 'n_words': 153}