File tree 1 file changed +5
-13
lines changed
1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change 23
23
import com .google .gson .GsonBuilder ;
24
24
import java .util .Arrays ;
25
25
import java .util .List ;
26
+ import java .util .Objects ;
26
27
import javax .annotation .PostConstruct ;
27
28
import org .junit .Test ;
28
29
@@ -89,13 +90,8 @@ public boolean equals(Object o) {
89
90
return false ;
90
91
}
91
92
Sandwich other = (Sandwich ) o ;
92
- if (this .bread == null ? other .bread != null : !this .bread .equals (other .bread )) {
93
- return false ;
94
- }
95
- if (this .cheese == null ? other .cheese != null : !this .cheese .equals (other .cheese )) {
96
- return false ;
97
- }
98
- return true ;
93
+
94
+ return Objects .equals (this .bread , other .bread ) && Objects .equals (this .cheese , other .cheese );
99
95
}
100
96
}
101
97
@@ -116,12 +112,8 @@ public boolean equals(Object o) {
116
112
return false ;
117
113
}
118
114
MultipleSandwiches other = (MultipleSandwiches ) o ;
119
- if (this .sandwiches == null
120
- ? other .sandwiches != null
121
- : !this .sandwiches .equals (other .sandwiches )) {
122
- return false ;
123
- }
124
- return true ;
115
+
116
+ return Objects .equals (this .sandwiches , other .sandwiches );
125
117
}
126
118
}
127
119
}
You can’t perform that action at this time.
0 commit comments