import java.util.function.Supplier;

// The main method must be in a class named "Main".
class Main {
	static class Greeting {
		public static String say() {
			return new String("Hello");
		}
	}

	private static class UniTest {

		/**
		 * @see Supplier#get()
		 */
		public void supplier_no_input(Supplier<String> greeting) {
			System.out.println("you say ->" + greeting.get());
		}

		/**
		 * @see ClassSupplier#getSystemDate()
		 */
		public void supplier_no_input() {
			// invocazione di un metodo
			Supplier<String> greeting = Greeting::say;

			System.out.println("you say ->" + greeting.get() + "<-");
		}
	}

	public static void main(String args[]) {
		// Unit test - crea uno scenario ( lamda expression )
		new UniTest().supplier_no_input(() -> new String("Hello") + "<-");

		// Unit test - crea uno scenario ( assegnazione )
		new UniTest().supplier_no_input();
	}
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: