For this case you could use interfaces from default library (java 1.8):
java.util.function.BiConsumer
java.util.function.BiFunction
There is a small (not the best) example of default method in interface:
default BiFunction<File, String, String> getFolderFileReader() {
return (directory, fileName) -> {
try {
return FileUtils.readFile(directory, fileName);
} catch (IOException e) {
LOG.error("Unable to read file {} in {}.", fileName, directory.getAbsolutePath(), e);
}
return "";
};
}}