@Override
	public InetSocketAddress resolve(ServerWebExchange exchange) {
		List<String> xForwardedValues = extractXForwardedValues(exchange);
		if (!xForwardedValues.isEmpty()) {
			int index = Math.max(0, xForwardedValues.size() - maxTrustedIndex);
			return new InetSocketAddress(xForwardedValues.get(index), 0);
		}
		return defaultRemoteIpResolver.resolve(exchange);
	}
@Test
	public void trustOneFallsBackOnMultipleHeaders() {
		ServerWebExchange exchange = buildExchange(
				remoteAddressOnlyBuilder().header("X-Forwarded-For", "0.0.0.1").header("X-Forwarded-For", "0.0.0.2"));

		InetSocketAddress address = trustOne.resolve(exchange);

		assertThat(address.getHostName()).isEqualTo("0.0.0.0");
	}