package es.sandbox.spikes.java8.interfaces;

import es.sandbox.spikes.java8.InvocationSpy;
import org.junit.Before;
import org.junit.Test;

import static es.sandbox.spikes.java8.InvocationSpy.spy;
import static org.assertj.core.api.Assertions.assertThat;

/**
 * Created by jeslopalo on 30/12/15.
 */
public class FunctionalInterfaceSpecs {

    private InvocationSpy spy;

    private static final void callFunctionalInterface(SimpleFunctionalInterface functionalInterface) {
        functionalInterface.doWork();
    }

    @Before
    public void setup() {
        this.spy = spy();
    }

    @Test
    public void has_one_callable_method() {
        callFunctionalInterface(() -> this.spy.invocation());

        assertThat(this.spy.invoked()).isTrue();
    }
}

@@ -133,16 +133,86 @@
 .Test;%0A%0A
+import static es.sandbox.spikes.java8.FunctionalInterfaceCaller.call;%0A
 import s
@@ -256,24 +256,24 @@
 ionSpy.spy;%0A
-
 import stati
@@ -441,156 +441,8 @@
 y;%0A%0A
-    private static final void callFunctionalInterface(SimpleFunctionalInterface functionalInterface) %7B%0A        functionalInterface.doWork();%0A    %7D%0A%0A
     
@@ -558,24 +558,24 @@
 _method() %7B%0A
+
         call
@@ -574,35 +574,16 @@
     call
-FunctionalInterface
 (() -%3E t

Refactor utility method to FunctionalInterfaceCaller