Here you can find the source of stream(Class
public static <T extends Enum<?>> Stream<T> stream(Class<T> clazz)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.stream.Stream; public class Main { public static <T extends Enum<?>> Stream<T> stream(Class<T> clazz) { return Arrays.stream(clazz.getEnumConstants()); }/*from w ww.ja v a2s . com*/ }