@@ -132,7 +132,7 @@ void setsNewHashSetWithIterablesFilter() {
132132 import com.google.common.collect.Sets;
133133
134134 class Test {
135- public static void test() {
135+ void test() {
136136 final List<ClassCastException> result = new ArrayList<ClassCastException>();
137137 List<Exception> myExceptions = new ArrayList<Exception>();
138138 result.addAll(Sets.newHashSet(Iterables.filter(myExceptions, ClassCastException.class)));
@@ -152,8 +152,7 @@ void setsNewHashSetWithCustomIterable() {
152152 import com.google.common.collect.Sets;
153153
154154 class Test {
155- public static void test() {
156- Iterable<String> myIterable = () -> java.util.List.of("a", "b").iterator();
155+ void test(Iterable<String> myIterable) {
157156 var result = Sets.newHashSet(myIterable);
158157 }
159158 }
@@ -170,26 +169,22 @@ void setsNewHashSetWithCollectionStillWorks() {
170169 """
171170 import com.google.common.collect.Sets;
172171
173- import java.util.ArrayList;
174172 import java.util.List;
175173 import java.util.Set;
176174
177175 class Test {
178- public static void test() {
179- List<String> myList = new ArrayList<>();
176+ public static void test(List<String> myList) {
180177 Set<String> result = Sets.newHashSet(myList);
181178 }
182179 }
183180 """ ,
184181 """
185- import java.util.ArrayList;
186182 import java.util.HashSet;
187183 import java.util.List;
188184 import java.util.Set;
189185
190186 class Test {
191- public static void test() {
192- List<String> myList = new ArrayList<>();
187+ public static void test(List<String> myList) {
193188 Set<String> result = new HashSet<>(myList);
194189 }
195190 }
0 commit comments