Port of Promises/A+ to Java