class HttpUtil {

    public static <T> T executePost( final String url, final Object requestBody, final Class<T> valueType )
    {

        // check that url is not null and blank
        if ( StringUtils.isBlank( url ) )
        {
            logger.warn( "In executePost, URL is either null or blank.", url );
            return null;
        }

        // check that request body is not null.
        if ( requestBody == null )
        {
            logger.warn( "In executePost, request body is null." );
            return null;
        }

        // check that response type is not null.
        if ( valueType == null )
        {
            logger.warn( "In executePost, response type is null." );
            return null;
        }
        HttpEntity httpEntity = HttpUtil.getStringEntity( requestBody );
        if ( httpEntity == null )
        {
            logger.warn( "In executePost, failed to serialize request body as JSON payload." );
            return null;
        }
        return HttpUtil.executePost( url, httpEntity, HttpUtil.getResponseHandler( valueType ) );
    }

}