@@ -0,0 +1,701 @@
+package com.twolattes.json.enumimpl;%0D%0A%0D%0Aimport static junit.framework.Assert.fail;%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0A%0D%0Aimport java.lang.reflect.Constructor;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Apublic class ReflectionOnEnums %7B%0D%0A%0D%0A  enum Abc %7B A, B, C %7D;%0D%0A%0D%0A  @Test%0D%0A  public void cannotInstantiateNewEnumValue() throws Exception %7B%0D%0A    Constructor%3C?%3E%5B%5D constructors = Abc.class.getDeclaredConstructors();%0D%0A    assertEquals(1, constructors.length);%0D%0A    constructors%5B0%5D.setAccessible(true);%0D%0A    try %7B%0D%0A      constructors%5B0%5D.newInstance();%0D%0A      fail();%0D%0A    %7D catch (IllegalArgumentException e) %7B%0D%0A      assertEquals(%22Cannot reflectively create enum objects%22, e.getMessage());%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A%7D%0D%0A

Test for enum instantiation.