Using Java on Android, I want to merge an element into a Map with a custom remapping function.
Map<String, MyObject> map = new HashMap<String, MyObject>(); // init map with some values here.... then MyObject xMyObject = new MyObject(123); // init this instance of MyObject map.merge("key", xMyObject, myRemappingFunction);
I understand Android Java does not have Java 8 support for lambda expressions. So I think I need to implement myRemappingFunction as a BiFunction, but I'm having trouble with understanding the BiFunction interface declaration to get anything to compile.
public static BiFunction<? super MyObject,? super MyObject,? extends MyObject> remappingfunction()
Any hints please?