@@ -0,0 +1,1408 @@
+package com.damienfremont.blog;%0A%0Aimport java.io.File;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.apache.commons.io.IOUtils;%0Aimport org.apache.commons.lang3.StringUtils;%0A%0A// STABLE: COMMONS-LANG%0Apublic class Java4CommonsLangImpl implements Features %7B%0A%0A%09public boolean condition(String arg) %7B%0A%09%09return StringUtils.isNotBlank(arg);%0A%09%7D%0A%0A%09public void check(String arg) %7B%0A%09%09if (!condition(arg)) %7B%0A%09%09%09throw new IllegalArgumentException();%0A%09%09%7D%0A%09%7D%0A%0A%09public List filter(List input) %7B%0A%09%09List output = new ArrayList();%0A%09%09for (int i = 0; i %3C input.size(); i++) %7B%0A%09%09%09String current = (String) input.get(i);%0A%09%09%09if (condition(current)) %7B%0A%09%09%09%09output.add(current);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return output;%0A%09%7D%0A%0A%09public List map(List input) %7B%0A%09%09List output = new ArrayList();%0A%09%09for (int i = 0; i %3C input.size(); i++) %7B%0A%09%09%09String current = (String) input.get(i);%0A%09%09%09String transformed = current.toUpperCase();%0A%09%09%09output.add(transformed);%0A%09%09%7D%0A%09%09return output;%0A%09%7D%0A%0A%09public void errorHandling(Exception e) %7B%0A%09%09throw new RuntimeException(e.getMessage(), e);%0A%09%7D%0A%0A%09public String loadFile(String path) throws Exception %7B%0A%09%09File file = new File(path);%0A%09%09return FileUtils.readFileToString(file);%0A%09%7D%0A%0A%09public String loadResource(String name) throws Exception %7B%0A%09%09ClassLoader classLoader = this.getClass().getClassLoader();%0A%09%09return IOUtils.toString(classLoader.getResourceAsStream(name));%0A%09%7D%0A%7D%0A

Create Java4CommonsLangImpl.java