### Question:
LibraryFieldUtil { public static int getNativeIntValue(final Class klass, final String fieldName) { try { final Field field = klass.getField(fieldName); return field.getInt(null); } catch (NoSuchFieldException | IllegalAccessException e) { log.error("Failed to get field value for '{}' in {}: {}", fieldName, klass, e.getMessage()); throw new IllegalStateException("Failed to get field value for '" + fieldName + "' from " + klass.getCanonicalName(), e); } } private  LibraryFieldUtil(); static int getNativeIntValue(final Class klass, final String fieldName); static int countClassField(final Class klass);  }### Answer:
@Test void getNativeIntValue() { final int nativeIntValue = LibraryFieldUtil.getNativeIntValue(EdsdkLibrary.EdsFileAttributes.class, EdsFileAttributes.kEdsFileAttribute_Archive.name()); Assertions.assertTrue(nativeIntValue > 0); }
@Test void getNativeIntValueThrowsOnNotFound() { Assertions.assertThrows(IllegalStateException.class, () -> LibraryFieldUtil.getNativeIntValue(EdsdkLibrary.EdsFileAttributes.class, "doNoExist")); }