ReflectionUtil { public static Field unfinalField(Field field) throws Exception { int modifiers = field.getModifiers(); if ((modifiers & _STATIC_FINAL) == _STATIC_FINAL) { _modifiersField.setInt(field, modifiers - Modifier.FINAL); } return field; }  static Object arrayClone(Object array); static Field getDeclaredField(Class<?> clazz, String name); static Field[] getDeclaredFields(Class<?> clazz); static Method getDeclaredMethod(
			Class<?> clazz, String name, Class<?>... parameterTypes); static Class<?>[] getInterfaces(Object object); static Class<?>[] getInterfaces(
		Object object, ClassLoader classLoader); static Class<?>[] getInterfaces(
		Object object, ClassLoader classLoader,
		Consumer<ClassNotFoundException> classNotFoundHandler); static T throwException(Throwable throwable); static Field unfinalField(Field field);  }
@Test public void testUnfinalField() throws Exception { Field field = TestClass.class.getDeclaredField( "_privateStaticFinalObject"); Assert.assertTrue(Modifier.isFinal(field.getModifiers())); Assert.assertTrue(Modifier.isPrivate(field.getModifiers())); Assert.assertTrue(Modifier.isStatic(field.getModifiers())); ReflectionUtil.unfinalField(field); Assert.assertFalse(Modifier.isFinal(field.getModifiers())); Assert.assertTrue(Modifier.isPrivate(field.getModifiers())); Assert.assertTrue(Modifier.isStatic(field.getModifiers())); ReflectionUtil.unfinalField(field); Assert.assertFalse(Modifier.isFinal(field.getModifiers())); Assert.assertTrue(Modifier.isPrivate(field.getModifiers())); Assert.assertTrue(Modifier.isStatic(field.getModifiers())); }