package net.md_5.bungee;

import java.net.InetAddress;
import java.net.UnknownHostException;
import org.junit.Assert;
import org.junit.Test;

public class ThrottleTest
{

    @Test
    public void testThrottle() throws InterruptedException, UnknownHostException
    {
        ConnectionThrottle throttle = new ConnectionThrottle( 5 );
        InetAddress address = InetAddress.getLocalHost();

        Assert.assertFalse( "Address should not be throttled", throttle.throttle( address ) );
        Assert.assertTrue( "Address should be throttled", throttle.throttle( address ) );

        throttle.unthrottle( address );
        Assert.assertFalse( "Address should not be throttled", throttle.throttle( address ) );

        Thread.sleep( 15 );
        Assert.assertFalse( "Address should not be throttled", throttle.throttle( address ) );
    }
}

@@ -359,38 +359,189 @@
 ress
- = InetAddress.getLocalHost();
+;%0A        %0A        try %7B%0A            address = InetAddress.getLocalHost();%0A        %7D catch (UnknownHostException ex) %7B%0A            address = InetAddress.getByName( null );%0A        %7D
 %0A%0A  

Fix compile error when compiling on OS X