### Question:
Enum implements Serializable, Comparable<Enum<T>> { @JsonValue public final T getKey() { return key; } protected  Enum(T key); @SuppressWarnings("unchecked") static E valueOf(Class<? extends E> enumClass, Object key); @SuppressWarnings("unchecked") static List<E> values(Class<? extends E> enumClass); @JsonValue final T getKey(); @SuppressWarnings("unchecked") Class<? extends Enum<T>> getEnumClass(); @Override int compareTo(Enum<T> o); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void shouldNotAllowDuplicatedKeys() { try { DuplicatedKeyEnum.GREEN.getKey(); fail("ExceptionInInitializerError must be thrown"); } catch (ExceptionInInitializerError e) { assertThat(e.getException()).isInstanceOf(IllegalStateException.class); } }
@Test void shouldNotAllowNullClassName() { try { NullClassEnum.PLUS.getKey(); fail("ExceptionInInitializerError must be thrown"); } catch (ExceptionInInitializerError e) { assertThat(e.getException()).isInstanceOf(IllegalStateException.class); } }
@Test void shouldNotAllowInvalidClassName() { try { InvalidClassEnum.PLUS.getKey(); fail("ExceptionInInitializerError must be thrown"); } catch (ExceptionInInitializerError e) { assertThat(e.getException()).isInstanceOf(IllegalStateException.class); } }