/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2017 BMW Car IT GmbH
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package io.joynr.util;

import static com.google.common.collect.Iterables.toArray;
import static com.google.inject.Guice.createInjector;
import static com.google.inject.util.Modules.combine;

import org.junit.Before;

import com.google.inject.Injector;
import com.google.inject.Module;

public abstract class GuiceBasedTest {
    private static Injector injector = null;
    private static Class<?> lastType = null;

    @Before
    public void setUp() throws Exception {
        injectMembers();
    }

    public abstract Iterable<Module> getModules();

    protected void injectMembers() {
        getInjector().injectMembers(this);
    }

    protected Injector getInjector() {
        if (lastType != getClass() || injector == null) {
            injector = createInjector(combine(toArray(getModules(), Module.class)));
            lastType = getClass();
        }
        return injector;
    }
}

@@ -655,67 +655,8 @@
 l;%0A%0A
-import static com.google.common.collect.Iterables.toArray;%0A
 impo
@@ -756,24 +756,64 @@
 s.combine;%0A%0A
+import java.util.stream.StreamSupport;%0A%0A
 import org.j
@@ -1398,42 +1398,145 @@
 ine(
-toArray(getModules(), Module.class
+StreamSupport.stream(getModules().spliterator(), false)%0A                                                           .toArray(Module%5B%5D::new
 )));

replace Iterables.toArray by Stream