Some ideas inspired by this blog post
http://benjiweber.co.uk/blog/2013/12/28/typesafe-database-interaction-with-java-8/
https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html
https://docs.oracle.com/javase/8/docs/api/java/lang/invoke/SerializedLambda.html
http://cglib.sourceforge.net/apidocs/net/sf/cglib/proxy/MethodInterceptor.html