Designing tail recursion using java 8
问题 I was trying out the following example provide in the talk to understand the tail recursion in java8. @FunctionalInterface public interface TailCall<T> { TailCall<T> apply(); default boolean isComplete() { return false; } default T result() { throw new Error("not implemented"); } default T get() { return Stream.iterate(this, TailCall::apply).filter(TailCall::isComplete) .findFirst().get().result(); } } Utility class to use the TailCall public class TailCalls { public static <T> TailCall<T>