### Question:
ParseEnum implements IsParser<Enum> { @Override public Enum parse(Object o, Field field) { Class<? extends Enum> enumClass = (Class<? extends Enum>) field.getType(); return isValid(o) ? valueOf(enumClass, o.toString()) : null; }  @Override Enum parse(Object o, Field field); @Override void setCell(Enum o, Cell cell, Field field);  }### Answer:
@Test public void parse() throws Exception { Enum actual = parseEnum.parse(null, this.getClass().getDeclaredField("sampleEnum")); assertEquals(null, actual); actual = parseEnum.parse("FIRST", this.getClass().getDeclaredField("sampleEnum")); assertEquals(SAMPLE_ENUM.FIRST, actual); }
@Test(expected = IllegalArgumentException.class) public void parseWithWrongField() throws NoSuchFieldException { parseEnum.parse("SECOND", this.getClass().getDeclaredField("declaredField")); fail("should be throw IllegalArgumentException"); }