@@ -0,0 +1,955 @@
+package org.codefx.lab.elvis;%0A%0Aimport java.util.function.Function;%0A%0A/**%0A * Utility class with static methods which allow null safe chaining of functions.%0A */%0Apublic class Elvis %7B%0A%0A%09public static %3CT1, T2%3E T2 applyNullCoalescing(T1 target, Function%3CT1, T2%3E f) %7B%0A%09%09if (target == null)%0A%09%09%09return null;%0A%0A%09%09return f.apply(target);%0A%09%7D%0A%0A%09public static %3CT1, T2, T3%3E T3 applyNullCoalescing(T1 target, Function%3CT1, T2%3E f1, Function%3CT2, T3%3E f2) %7B%0A%09%09return applyNullCoalescing(applyNullCoalescing(target, f1), f2);%0A%09%7D%0A%0A%09public static %3CT1, T2, T3, T4%3E T4 applyNullCoalescing(T1 target,%0A%09%09%09Function%3CT1, T2%3E f1, Function%3CT2, T3%3E f2, Function%3CT3, T4%3E f3) %7B%0A%09%09return applyNullCoalescing(applyNullCoalescing(target, f1, f2), f3);%0A%09%7D%0A%0A%09public static %3CT1, T2, T3, T4, T5%3E T5 applyNullCoalescing(T1 target,%0A%09%09%09Function%3CT1, T2%3E f1, Function%3CT2, T3%3E f2, Function%3CT3, T4%3E f3, Function%3CT4, T5%3E f4) %7B%0A%09%09return applyNullCoalescing(applyNullCoalescing(target, f1, f2, f3), f4);%0A%09%7D%0A%0A%7D%0A

Implement Elvis operator