### Question:
EnumValueUtils { @Nullable public static <T extends Enum<T>> T resolveEnumValue( @Nonnull Object object, @Nonnull String propertyPath, @Nullable Object enumValueName ) { final String stringEnumName = (enumValueName == null) ? null : enumValueName.toString(); if ( stringEnumName == null ) { return null; } final Class<?> propertyClass; try { propertyClass = PropertyUtils.getPropertyType( object, propertyPath ); } catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException | IllegalArgumentException e ) { throw new IllegalArgumentException( "Could not resolve property " + propertyPath + " of object " + object.getClass().getSimpleName(), e ); } if ( !propertyClass.isEnum() ) { throw new IllegalArgumentException( "Property " + propertyPath + " of object " + object.getClass().getSimpleName() + " is no enumeration class: " + propertyClass.getSimpleName() ); } @SuppressWarnings( "unchecked" ) final Class<T> uncheckedEnumClass = (Class<T>) propertyClass; return NameUtils.toEnumValue( uncheckedEnumClass, stringEnumName ); } private  EnumValueUtils(); @Nullable static T resolveEnumValue( @Nonnull Object object, @Nonnull String propertyPath, @Nullable Object enumValueName );  }### Answer:
@Test public void resolveEnumValueNull() { Assert.assertNull( EnumValueUtils.resolveEnumValue( outer, "inner.unit", null ) ); }
@Test public void resolveEnumValueNullString() { Assert.assertNull( EnumValueUtils.resolveEnumValue( outer, "inner.unit", new Object() { @Override public String toString() { return null; } } ) ); }
@Test public void resolveEnumValue() { Assert.assertEquals( ChronoUnit.HALF_DAYS, EnumValueUtils.resolveEnumValue( outer, "inner.unit", "half-days" ) ); }