New JoinVarArgsContains inspection that will detect multiple .contains(), .doesNotContain(), and .containsOnlyOnce() calls within the same statement that could be joined together using variadic arguments.
This commit is contained in:
@@ -30,6 +30,13 @@ public class Java8Optional {
|
||||
assertThat(opt).isPresent();
|
||||
assertThat(opt).isPresent();
|
||||
|
||||
//assertThat(opt.get()).isEqualTo(opt.get()); // there's a better version than contains(opt.get())
|
||||
assertThat(opt.orElse(null)).isEqualTo(opt.get());
|
||||
//assertThat(opt.get()).isEqualTo(opt.orElse(null)); // there's a better version than contains(opt.orElse(null))
|
||||
|
||||
assertThat(opt).contains(opt.get());
|
||||
assertThat(opt).contains(opt.orElse(null));
|
||||
|
||||
String possibleNullString = System.getProperty("username");
|
||||
String notNullString = "Narf";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user