### Question:
Lambdas { public static <T, U> T makeLambda( Class<T> lambdaType, Generator<U> returnValueGenerator, GenerationStatus status) { if (singleAbstractMethodOf(lambdaType) == null) { throw new IllegalArgumentException( lambdaType + " is not a functional interface type"); } return lambdaType.cast( newProxyInstance( lambdaType.getClassLoader(), new Class<?>[] { lambdaType }, new LambdaInvocationHandler<>( lambdaType, returnValueGenerator, status.attempts()))); } private  Lambdas(); static T makeLambda(
        Class<T> lambdaType,
        Generator<U> returnValueGenerator,
        GenerationStatus status);  }### Answer:
@Test public void rejectsNonFunctionalInterface() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage(Cloneable.class + " is not a functional interface"); makeLambda(Cloneable.class, new AnInt(), status); }
@Test public void invokingDefaultMethodOnFunctionalInterface() { System.out.println(System.getProperty("java.version")); @SuppressWarnings("unchecked") Predicate<Integer> another = makeLambda(Predicate.class, returnValueGenerator, status); boolean firstResult = predicate.test(4); boolean secondResult = another.test(4); assertEquals(firstResult || secondResult, predicate.or(another).test(4)); }
@Test public void equalsBasedOnIdentity() { Predicate<?> duplicate = makeLambda(Predicate.class, returnValueGenerator, status); assertEquals(predicate, predicate); assertEquals(duplicate, duplicate); assertNotEquals(predicate, duplicate); assertNotEquals(duplicate, predicate); }