How To Pass Function In Java