findAndModify() java function