Java clone of Observable/Observer pattern in Swift