public static synchronized int nextAvailablePort() {
		int result = SocketUtils.findAvailableServerSocket(lastAllocatedPort);
		lastAllocatedPort = result + 1;
		if (lastAllocatedPort >= 65535) {
			// Hopefully this won't happen during a test suite, but...
			lastAllocatedPort = 1025;
		}
		return result;
	}
Utility class to find available server ports.

<p>
Leverages {@link SocketUtils#findAvailableServerSocket} but in addition remembers
the allocated ports. This is because the port may not be used immediately after
it is found and thus may be re-allocated on subsequent calls.
</p>

@author Eric Bottard
spring-xd-test-fixtures/src/main/java/org/springframework/xd/test/fixtures/util/AvailableSocketPorts.java