Skip to content

Instantly share code, notes, and snippets.

@faloi
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faloi/daaef4d877c5042b4f53 to your computer and use it in GitHub Desktop.
Save faloi/daaef4d877c5042b4f53 to your computer and use it in GitHub Desktop.
@Test
public void puedeInstanciarseUnaLambdaPorElNombreDeSuClase() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
Function<Integer, Integer> lambda = (num) -> num * 2;
Object lambda2 = Class.forName(lambda.getClass().getName()).newInstance();
assertEquals(lambda.getClass(), lambda2.getClass());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment