@Test void modifyCollection_different() { TestDataFiller tdf = new TestDataFiller(); List<SimpleType> simpleTypes = tdf.fillInstances(SimpleType.class, 3); FakegenUtils.modifyCollection(simpleTypes, simpleType -> simpleType.setName("Set By Consumer 1"), simpleType -> simpleType.setName("Set By Consumer 2"), simpleType -> simpleType.setName("Set By Consumer 3")); assertThat(simpleTypes.get(0).getName()).isEqualTo("Set By Consumer 1"); assertThat(simpleTypes.get(1).getName()).isEqualTo("Set By Consumer 2"); assertThat(simpleTypes.get(2).getName()).isEqualTo("Set By Consumer 3"); }
@SafeVarargs public static <T> void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers) { int counter = 0; for (T target : targets) { suppliers[counter % suppliers.length].accept(target); counter++; } }
FakegenUtils { @SafeVarargs public static <T> void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers) { int counter = 0; for (T target : targets) { suppliers[counter % suppliers.length].accept(target); counter++; } } }
FakegenUtils { @SafeVarargs public static <T> void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers) { int counter = 0; for (T target : targets) { suppliers[counter % suppliers.length].accept(target); counter++; } }  }
FakegenUtils { @SafeVarargs public static <T> void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers) { int counter = 0; for (T target : targets) { suppliers[counter % suppliers.length].accept(target); counter++; } }  static void inject(@NonNull Object target, @NonNull String fieldName, Object value); @SafeVarargs static void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers); }
FakegenUtils { @SafeVarargs public static <T> void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers) { int counter = 0; for (T target : targets) { suppliers[counter % suppliers.length].accept(target); counter++; } }  static void inject(@NonNull Object target, @NonNull String fieldName, Object value); @SafeVarargs static void modifyCollection(@NonNull Iterable<T> targets, @NonNull Consumer<T>... suppliers);  }