Added consuming with a Java method example