### Question:
CpkCoreService { public void getElementsList( OutputStream out, Map<String, Map<String, Object>> bloatedMap ) { String elements = getElementsList(); if ( elements != null ) { writeMessage( out, elements ); } } CpkCoreService( ICpkEnvironment environment ); CpkEngine getEngine(); CpkCoreService setEngine( CpkEngine engine ); void createContent( Map<String, Map<String, Object>> bloatedMap ); String getLocalizationResourceContent( String elementId, String resource ); void reload( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String reload( Map<String, Map<String, Object>> bloatedMap ); void refresh( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String refresh( Map<String, Map<String, Object>> bloatedMap ); void clearKettleResultsCache(); void status( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String status( Map<String, Map<String, Object>> bloatedMap ); void statusJson( OutputStream out, HttpServletResponse response ); String statusJson( HttpServletResponse response ); boolean hasElement( String elementId ); Collection<IElement> getElements(); void getElementsList( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String getElementsList(); IElement getDefaultElement(); RestRequestHandler getRequestHandler();  }### Answer:
@Test public void testGetElementsList() throws IOException, JSONException { OutputStream out = new ByteArrayOutputStream(); cpkCore.getElementsList( out, bloatedMap ); String str = out.toString(); JSONArray elementsListJson = new JSONArray( str ); assertTrue( checkIdLength( elementsListJson ) ); out.close(); }
@Test public void testGetElementsListStringResult() throws JSONException { String actualResult = cpkCore.getElementsList(); JSONArray elementsListJson = new JSONArray( actualResult ); assertTrue( checkIdLength( elementsListJson ) ); }