@Test void modifyCollection_one() { TestDataFiller tdf = new TestDataFiller(); List<SimpleType> simpleTypes = tdf.fillInstances(SimpleType.class, 1); FakegenUtils.modifyCollection(simpleTypes, simpleType -> simpleType.setName("Set By Consumer")); assertThat(simpleTypes) .allSatisfy(simpleType -> assertThat(simpleType.getName()).isEqualTo("Set By Consumer")); }
@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);  }