BooleanUtils { public static Mono<Boolean> xor(Mono<Boolean> value1, Mono<Boolean> value2) { return Mono.zip(value1, value2, (bool1, bool2) -> (bool1 != bool2) && (bool1 || bool2)); } private  BooleanUtils(); static Mono<Boolean> not(Mono<Boolean> value); static Mono<Boolean> and(Mono<Boolean> value1, Mono<Boolean> value2); static Mono<Boolean> xor(Mono<Boolean> value1, Mono<Boolean> value2); static Mono<Boolean> or(Mono<Boolean> value1, Mono<Boolean> value2); static Mono<Boolean> nand(Mono<Boolean> value1, Mono<Boolean> value2); static Mono<Boolean> nor(Mono<Boolean> value1, Mono<Boolean> value2);  }
@Test public void testXor() { StepVerifier.create(xor(TRUE, TRUE)) .assertNext(bool -> assertThat(bool).as("xor(TRUE, TRUE)").isFalse()) .verifyComplete(); StepVerifier.create(xor(TRUE, FALSE)) .assertNext(bool -> assertThat(bool).as("xor(TRUE, FALSE)").isTrue()) .verifyComplete(); StepVerifier.create(xor(FALSE, TRUE)) .assertNext(bool -> assertThat(bool).as("xor(FALSE, TRUE)").isTrue()) .verifyComplete(); StepVerifier.create(xor(FALSE, FALSE)) .assertNext(bool -> assertThat(bool).as("xor(FALSE, FALSE)").isFalse()) .verifyComplete(); }