@@ -0,0 +1,2039 @@
+/*%0A * This is free and unencumbered software released into the public domain.%0A *%0A * Anyone is free to copy, modify, publish, use, compile, sell, or%0A * distribute this software, either in source code form or as a compiled%0A * binary, for any purpose, commercial or non-commercial, and by any%0A * means.%0A *%0A * In jurisdictions that recognize copyright laws, the author or authors%0A * of this software dedicate any and all copyright interest in the%0A * software to the public domain. We make this dedication for the benefit%0A * of the public at large and to the detriment of our heirs and%0A * successors. We intend this dedication to be an overt act of%0A * relinquishment in perpetuity of all present and future rights to this%0A * software under copyright law.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND,%0A * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF%0A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.%0A * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR%0A * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,%0A * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR%0A * OTHER DEALINGS IN THE SOFTWARE.%0A *%0A * For more information, please refer to %3Chttp://unlicense.org/%3E.%0A */%0A%0Apackage hm.binkley.junit;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.net.ServerSocket;%0A%0Aimport static org.hamcrest.Matchers.equalTo;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0A/**%0A * %7B@code ProvidePortTest%7D tests %7B@link ProvidePort%7D.%0A *%0A * @author %3Ca href=%22mailto:binkley@alumni.rice.edu%22%3EB. K. Oxley (binkley)%3C/a%3E%0A */%0Apublic class ProvidePortTest %7B%0A    @Rule%0A    public final ProvidePort port = new ProvidePort();%0A%0A    @Test%0A    public void shouldBind()%0A            throws IOException %7B%0A        try (final ServerSocket serverSocket = new ServerSocket(port.port())) %7B%0A            assertThat(serverSocket.getLocalPort(), is(equalTo(port.port())));%0A        %7D%0A    %7D%0A%7D%0A

Test provide port rule.