ReflectionLoader { public static Object getField(Object object, String field) throws ReflectionException { try { Field f = object.getClass().getDeclaredField(field); f.setAccessible(true); return f.get(object); } catch(NoSuchFieldException e) { log.error("Unable to invoke field, could not be found", e); throw new ReflectionException("Unable to invoke field, could not be found", e); } catch (IllegalAccessException e) { log.error("Unable to invoke method, inaccessible", e); throw new ReflectionException("Unable to invoke method, inaccessible", e); } }  static T loadClass(Class<T> expectedSubtype, String className, Object[] args); static T loadClass(Class<T> expectedSubtype, String className, 
			Class<?>[] constructorArguments, Object[] args); static Object invokeMethod(Object object, String method, Class<?>[] params, Object... args); static Object getField(Object object, String field);  }
@Test public void testLoadPrivateField() throws Exception { TestClassWithPrivates tc = new TestClassWithPrivates(); Object result = ReflectionLoader.getField(tc, "privateField"); Assert.assertNotNull(result); Assert.assertEquals("Expected privateValue", "privateValue", result.toString()); }