Skip to content

Commit 6cdfc36

Browse files
runeflobakkmrwilson
authored andcommitted
Make it compile on Java 11
This is peculiar. It seems the type inference through multiple levels of method invokations is better with Java 8 than Java 11. Anyway, the outermost is(..) invocation is redundant (and in my opinion also decreases readability), so they are removed to make the code compile on Java 11.
1 parent 37fb391 commit 6cdfc36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/java/uk/co/probablyfine/matchers/StreamMatchersTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void equalTo_failureDifferingSingleItem() throws Exception {
2727

2828
@Test
2929
public void contains_failureDifferingSingleItem() throws Exception {
30-
assertThat(Stream.of("a"), is(Matchers.not(StreamMatchers.contains("b"))));
30+
assertThat(Stream.of("a"), not(StreamMatchers.contains("b")));
3131
}
3232

3333
@Test
@@ -37,7 +37,7 @@ public void equalTo_failureDifferingLength() throws Exception {
3737

3838
@Test
3939
public void contains_failureDifferingLength() throws Exception {
40-
assertThat(Stream.of("a"), is(Matchers.not(StreamMatchers.contains("a", "b"))));
40+
assertThat(Stream.of("a"), not(StreamMatchers.contains("a", "b")));
4141
}
4242

4343
@Test
@@ -47,7 +47,7 @@ public void equalTo_failureDifferingItems() throws Exception {
4747

4848
@Test
4949
public void contains_failureDifferingItems() throws Exception {
50-
assertThat(Stream.of("a","c"), is(Matchers.not(StreamMatchers.contains("a", "b"))));
50+
assertThat(Stream.of("a","c"), not(StreamMatchers.contains("a", "b")));
5151
}
5252

5353
@Test
@@ -232,11 +232,11 @@ public void equalTo_handles_types() {
232232

233233
@Test
234234
public void contains_handles_types() {
235-
assertThat("xyz", where(s -> s.chars().mapToObj(i -> (char) i), contains('x', 'y', 'z')));
235+
assertThat("xyz", where(s -> s.chars().mapToObj(i -> (char) i), StreamMatchers.contains('x', 'y', 'z')));
236236

237237
DescribableFunction<String, BaseStream<Character, Stream<Character>>> characters = s -> s.chars().mapToObj(i -> (char) i);
238-
assertThat("xyz", where(characters, contains('x', 'y', 'z')));
239-
assertThat("xyz", where(characters, not(contains('x', 'y'))));
238+
assertThat("xyz", where(characters, StreamMatchers.contains('x', 'y', 'z')));
239+
assertThat("xyz", where(characters, not(StreamMatchers.contains('x', 'y'))));
240240
}
241241

242242

0 commit comments

Comments
 (0)