### Question:
ExecutionPlanConverter { public static MapValue convert( ExecutionPlanDescription plan ) { boolean hasProfilerStatistics = plan.hasProfilerStatistics(); int size = hasProfilerStatistics ? 9 : 4; MapValueBuilder out = new MapValueBuilder( size ); out.add( "operatorType", stringValue( plan.getName() ) ); out.add( "args", ValueUtils.asMapValue( plan.getArguments() ) ); out.add( "identifiers", ValueUtils.asListValue( plan.getIdentifiers() ) ); out.add( "children", children( plan ) ); if ( hasProfilerStatistics ) { ExecutionPlanDescription.ProfilerStatistics profile = plan.getProfilerStatistics(); out.add( "dbHits", longValue( profile.getDbHits() ) ); out.add( "pageCacheHits", longValue( profile.getPageCacheHits() ) ); out.add( "pageCacheMisses", longValue( profile.getPageCacheMisses() ) ); out.add( "pageCacheHitRatio", doubleValue( profile.getPageCacheHitRatio() ) ); out.add( "rows", longValue( profile.getRows() ) ); } return out.build(); } private  ExecutionPlanConverter(); static MapValue convert( ExecutionPlanDescription plan );  }### Answer:
@Test public void profileStatisticConversion() { MapValue convertedMap = ExecutionPlanConverter.convert( new TestExecutionPlanDescription( "description", getProfilerStatistics(), getIdentifiers(), getArguments() ) ); assertEquals( convertedMap.get( "operatorType" ), stringValue( "description" ) ); assertEquals( convertedMap.get( "args" ), ValueUtils.asMapValue( getArguments() ) ); assertEquals( convertedMap.get( "identifiers" ), ValueUtils.asListValue( getIdentifiers() )); assertEquals( convertedMap.get( "children" ), VirtualValues.EMPTY_LIST ); assertEquals( convertedMap.get( "rows" ), longValue( 1L )); assertEquals( convertedMap.get( "dbHits" ), longValue( 2L ) ); assertEquals( convertedMap.get( "pageCacheHits" ), longValue( 3L ) ); assertEquals( convertedMap.get( "pageCacheMisses" ), longValue( 2L ) ); assertEquals( ((DoubleValue) convertedMap.get( "pageCacheHitRatio" )).doubleValue(), 3.0 / 5, 0.0001 ); assertEquals( convertedMap.size(), 9 ); }