### Question:
EnumUtilities { public static <T extends Enum<T>> T fromString(Class<T> type, String label) { return EnumSet.allOf(type).stream().filter(v -> v != null && Objects.equals(v.toString(), label)).findAny().orElse(null); } private  EnumUtilities(); static T fromString(Class<T> type, String label); static T valueOf(Class<T> type, String name, T defaultValue);  }### Answer:
@Test public void testFromStringClass() { Assert.assertEquals(TestEnum.ALPHA, EnumUtilities.fromString(TestEnum.class, "alpha")); Assert.assertEquals(TestEnum.BRAVO, EnumUtilities.fromString(TestEnum.class, "bravo")); Assert.assertEquals(TestEnum.CHARLIE, EnumUtilities.fromString(TestEnum.class, "charlie")); Assert.assertNull(EnumUtilities.fromString(TestEnum.class, "bad")); }