### Question:
HttpUtil { public static boolean isIPV4Address( final String name ) { if( StringUtils.isEmpty( name ) || name.charAt( 0 ) == DOT || name.charAt( name.length() - 1 ) == DOT ) { return false; } final int[] addr = new int[] { 0, 0, 0, 0 }; int currentOctet = 0; for( int i = 0; i < name.length(); i++ ) { if( currentOctet > 3 ) { return false; } final int ch = name.charAt( i ); final boolean isDigit = ch >= ONE && ch <= NINE; final boolean isDot = ch == DOT; if( !isDigit && !isDot ) { return false; } if( isDigit ) { addr[ currentOctet ] = 10 * addr[ currentOctet ] + ( ch - ONE ); if( addr[ currentOctet ] > 255 ) { return false; } } else if( name.charAt( i - 1 ) == DOT ) { return false; } else { currentOctet++; } } return currentOctet == 3; } private  HttpUtil(); static String getRemoteAddress( final HttpServletRequest req ); static String retrieveCookieValue( final HttpServletRequest request, final String cookieName ); static String createETag( final String pageName, final Date lastModified ); static boolean checkFor304( final HttpServletRequest req, final String pageName, final Date lastModified ); static String guessValidURI( String uri ); static String safeGetQueryString( final HttpServletRequest request, final Charset contentEncoding ); static boolean isIPV4Address( final String name );  }### Answer:
@Test public void testIsIPV4Address() { Assertions.assertFalse( HttpUtil.isIPV4Address( null ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( ".123.123.123.123" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "123.123.123.123." ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "123.123.123" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "123.123.123.123.123" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "abc.123.123.123" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "Me" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "Guest" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "1207.0.0.1" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "127..0.1" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "1207.0.0." ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( ".0.0.1" ) ); Assertions.assertFalse( HttpUtil.isIPV4Address( "..." ) ); Assertions.assertTrue( HttpUtil.isIPV4Address( "127.0.0.1" ) ); Assertions.assertTrue( HttpUtil.isIPV4Address( "12.123.123.123" ) ); Assertions.assertTrue( HttpUtil.isIPV4Address( "012.123.123.123" ) ); Assertions.assertTrue( HttpUtil.isIPV4Address( "123.123.123.123" ) ); }