Skip to content

Instantly share code, notes, and snippets.

View ChristianSchwarz's full-sized avatar

Christian Schwarz ChristianSchwarz

View GitHub Profile
@ChristianSchwarz
ChristianSchwarz / Reflect.java
Created June 26, 2018 13:38
Reified generics for Java 8 Lambdas
import sun.reflect.ConstantPool;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Objects;
/**
* This approach was inspired by code from @danielbodart