### Question:
JSONDataLoader { public ArrayList<Format> getFormats() throws IOException, JSONException { ArrayList<Format> formats = new ArrayList<>(); JSONObject jsonFormats = mLocalFileHelper.getJSONFormatsFile(); JSONArray formatData = jsonFormats.getJSONArray("data"); for (int i = 0; i < formatData.length(); i++) { JSONObject formatJSON = formatData.getJSONObject(i); formats.add(new Format(formatJSON)); } return formats; } JSONDataLoader(LocalFileHelper mLocalFileHelper); @NonNull ArrayList<Card> getCardsFromFile(String lanquagePref); @NonNull ArrayList<Pack> getPacksFromFile(); ArrayList<Cycle> getCyclesFromFile(); @NonNull MwlData getMwlDetails(); ArrayList<Format> getFormats(); ArrayList<Rotation> getRotations();  }### Answer:
@Test public void GetFormats_ReturnsAnArrayList_WithCoreExperience() throws JSONException, IOException { JSONDataLoader loader = new JSONDataLoader(helperMock); ArrayList<Format> formats = loader.getFormats(); assertNotNull(formats); assertEquals(5, formats.size()); Format format = formats.get(3); assertEquals(4, format.getId()); assertEquals("Core Experience", format.getName()); assertEquals("", format.getRotation()); assertEquals(0, format.getMwlId()); assertEquals(1, format.getPacks().size()); }
@Test public void GetFormats_ReturnsAnArrayList_WithStandard() throws JSONException, IOException { JSONDataLoader loader = new JSONDataLoader(helperMock); ArrayList<Format> formats = loader.getFormats(); assertNotNull(formats); assertEquals(5, formats.size()); Format format = formats.get(0); assertEquals(1, format.getId()); assertEquals("Standard", format.getName()); assertNotEquals("", format.getRotation()); assertEquals(10, format.getMwlId()); assertEquals(0, format.getPacks().size()); }