### Question:
ExecutionProfileUtil { public static void outputExecutionProfile( OutputStream outputStream, IExecutionProfile executionProfile ) throws IOException { PrintStream out = null; try { if ( outputStream instanceof PrintStream ) { out = (PrintStream) outputStream; } else { out = new PrintStream( outputStream ); } ObjectMapper mapper = new ObjectMapper(); mapper.enable( SerializationFeature.INDENT_OUTPUT ); mapper.disable( SerializationFeature.FAIL_ON_EMPTY_BEANS ); mapper.enable( SerializationFeature.WRAP_EXCEPTIONS ); try { out.println( mapper.writeValueAsString( executionProfile ) ); } catch ( JsonProcessingException jpe ) { throw new IOException( jpe ); } } finally { IOUtils.closeQuietly( out ); } } protected  ExecutionProfileUtil(); static void outputExecutionProfile( OutputStream outputStream, IExecutionProfile executionProfile );  }### Answer:
@Test public void testOutputExecutionProfile() throws Exception { ExecutionProfileUtil.outputExecutionProfile( System.out, null ); ExecutionProfileUtil.outputExecutionProfile( System.out, executionProfile ); }
@Test( expected = IOException.class ) public void testOutputExecutionProfileWithException() throws IOException { PrintStream mockStream = mock( PrintStream.class ); doThrow( JsonProcessingException.class ).when( mockStream ).println( Mockito.anyString() ); ExecutionProfileUtil.outputExecutionProfile( mockStream, executionProfile ); }