demo future composition in java and scala