private void makeAccessible(List<AccessibleObject> nonPublicAccessibleObjects) {

    if (nonPublicAccessibleObjects.size() > 0) {
      final AccessibleObject[] nonPublicAccessibles = new AccessibleObject[nonPublicAccessibleObjects.size()];
      nonPublicAccessibleObjects.toArray(nonPublicAccessibles);
      // enable reflective access that violates visibility - this will
      // fail if disallowed by security-manager.
      AccessController.doPrivileged(new PrivilegedAction<Object>() {

        @Override
        public Object run() {

          AccessibleObject.setAccessible(nonPublicAccessibles, true);
          return null;
        }
      });
    }
  }
private void makeAccessible ( List < AccessibleObject > nonPublicAccessibleObjects ) { if ( nonPublicAccessibleObjects . size ( ) > 0 ) { final AccessibleObject [ ] nonPublicAccessibles = new AccessibleObject [ nonPublicAccessibleObjects . size ( ) ] ; nonPublicAccessibleObjects . toArray ( nonPublicAccessibles ) ; AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { @ Override public Object run ( ) { AccessibleObject . setAccessible ( nonPublicAccessibles , true ) ; return null ; } } ) ; } }
Makes all {@link AccessibleObject}s in the given {@link List} {@link AccessibleObject#setAccessible(boolean)
accessible}.

@param nonPublicAccessibleObjects is the {@link List} where the non-public {@link AccessibleObject}s have been
collected.