leonardo
5/11/2017 - 5:23 AM

factory.java

interface TV {
    void show();
}

enum TVFactory {
    COLOR {
        @Override
        TV create() {
            return () -> {
                System.out.println("Showing content in Color ... ");
            };
        }
    },
    LED {
        @Override
        TV create() {
            return () -> {
                System.out.println("Showing content using LED ... ");
            };
        }
    },
    // etc ... 
    ;
    abstract TV create();
}