-
Dynamic Extension with Intersection Type & Lambda
This is based on Toby Lee’s LiveCoding tv. https://www.youtube.com/watch?v=PQ58n0hk7DI FunctionalInterface Interface that has only one abstract method. private static void hello1(Function p0) { } public static void main(String[] args) { hello1(s -> s); } Old way, it normally created with anonymous class. At java8, lambda changes a lot of things! public static void anonymousClassExample() { Function<String, String> f = new Function<String, String>() { @Override public String apply(String s) { return null; } }; hello1(f); }...
-
Java Generics
Generics This is based on Toby Lee’s LiveCoding tv. https://www.youtube.com/watch?v=PQ58n0hk7DI static <T> void method1(List<T> list) { } static void unboundTypeWildCard(List<?> list) { // only allow add null list.add(null); // allow list's feature list.size(); list.clear(); Iterator<?> it = list.iterator(); } when we use generic methods with T, then we have intention to use type T, at below case, we just need to use List’s methods, so, ? is more suitable than T static <T> boolean isEmptyT(List<T>...
-
JUnit5 Summary
Overview Unlike previous versions of JUnit, JUnit 5 is composed of several different modules from three different sub-projects. JUnit 5 = JUnit Platform + JUnit Jupiter + JUnit Vintage JUnit Platform : The Foundation for launching testing frameworks on the JVM. It also defines the TestEngine API for developing a testing framework that runs on the platform. It also defines the TestEngine API for developing a testing framework that runs on the platform. JUnit Jupiter...
-
Observer Pattern
Definition The Observer pattern is a software design pattern in which an object, called the Subject, maintains a list of its dependent object, called Observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems. Loose Coupling Loose Coupling means that they interact each other, but they don’t know each other well. It is loosely coupled between Subject and Observer....
-
Hadoop Troubleshooting. (Hadoop Summit 2016 summary)
Overview Actually, i attended hadoop summit 2016 - tokyo at last month. So i am going to review some of the talks that i heard. Also you can download slides and watch the videos from youtube. slides youtube Unfortunately, just keynote videos were uploaded now. But i think each session’s video will be uploaded soon. This article is about Hadoop Troubleshooting, ‘How to overcome mysterious problems caused by large and multi-tenancy Hadoop cluster at Rakuten’...