Hamcrest: file1 或者 file2 存在

Hamcrest: file1 either file2 exists

我目前将我的测试从 AsserJ 重构到 hamcrest 库。但是有人断言我无法迁移到 hamcrest。

tmp1 和 tmp2 包含文件系统中的两个路径。我需要验证 tmp1 或 tmp2 是否存在,但不能同时存在。当前断言是

assertTrue(new File(tmp1).exists() ^ new File(tmp2).exists());

什么是等效的 hamcrest 测试?

 assertThat(new File(tmp1).exists() ^ new File(tmp2).exists(), is(true));