using method reference to get a simple code

using method reference to get a simple code