Class.cast is what you want. Well, you might consider not using reflection.
Change the line:
T result = (T)store.get(e);
to:
T result = exampleClass.cast(store.get(e));
Class.cast is what you want. Well, you might consider not using reflection.
Change the line:
T result = (T)store.get(e);
to:
T result = exampleClass.cast(store.get(e));