package unitestLibs;

import static org.junit.Assert.fail;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Uintility {
	
	public static class Reflection {
		
		public static Object newTestObj(Constructor ctruct, Object[] args) {
			
			Object testObj = null;
			
			try {
				
				ctruct.setAccessible(true);
				testObj = ctruct.newInstance(args);	
				
			} catch (InstantiationException
					 | IllegalAccessException
					 | IllegalArgumentException
					 | InvocationTargetException e
			) {
				e.printStackTrace();
				fail("Something wrong with the reflection on newing instance...");
			}	
			
			return testObj;
		}
		
		public static Method getPrivateMethod(Class cls, String name, Class[] params) {
			
			Method method = null;
			
			try {
				
				method = cls.getDeclaredMethod(name, params);
				method.setAccessible(true);
				
			} catch (NoSuchMethodException | SecurityException e) {
				e.printStackTrace();
				fail("Something wrong with the reflection on getting method...");
			}
			
			return method;
		}
	}
	
}

@@ -91,16 +91,48 @@
 ructor;%0A
+import java.lang.reflect.Field;%0A
 import j
@@ -701,20 +701,58 @@
 instance
-...%22
+ of class: %22 + ctruct.getClass().getName()
 );%0A%09%09%09%7D%09
@@ -1149,12 +1149,19 @@
 thod
-...%22
+: %22  + name
 );%0A%09
@@ -1190,15 +1190,395 @@
 od;%0A%09%09%7D%0A
+%09%09%0A%09%09public static Field getPrivateField(Class cls, String name) %7B%0A%09%09%09%0A%09%09%09Field field = null;%0A%09%09%09%0A%09%09%09try %7B%0A%09%09%09%09%0A%09%09%09%09field = cls.getDeclaredField(name);%0A%09%09%09%09field.setAccessible(true);%0A%09%09%09%09%0A%09%09%09%7D catch (NoSuchFieldException %7C SecurityException e) %7B%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%09fail(%22Something wrong with the reflection on getting field: %22 + name);%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09%0A%09%09%09return field;%0A%09%09%7D%0A
 %09%7D%0A%09%0A%7D%0A

Update unitest/unitestLibs/Uintility.java.