/**
 * The MIT License
 *
 * Copyright (C) 2015 Asterios Raptis
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package de.alpharogroup.reflection;

import org.testng.AssertJUnit;
import org.testng.annotations.Test;

import de.alpharogroup.test.objects.A;
import de.alpharogroup.test.objects.Person;


public class ReflectionExtensionsTest
{

	public void testGetNewInstance()
	{
	}

	@Test
	public void testNewInstanceClassOfT()
		throws InstantiationException, IllegalAccessException, ClassNotFoundException
	{
		final Class<Person> clazz = Person.class;
		final Person actual = ReflectionExtensions.newInstance(clazz);
		AssertJUnit.assertNotNull(actual);
	}

	@Test
	public void testNewInstanceT()
		throws InstantiationException, IllegalAccessException, ClassNotFoundException
	{
		final A a = new A();
		final A actual = ReflectionExtensions.newInstance(a);
		AssertJUnit.assertNotNull(actual);
	}

}

@@ -1930,12 +1930,1976 @@
 ual);%0A%09%7D
+%0A%09%0A%09/**%0A%09 * Test for %7B@link ReflectionExtensions#setFieldValue(Object, String, Object)%7D.%0A%09 *%0A%09 * @throws NoSuchFieldException%0A%09 *             is thrown if no such field exists.%0A%09 * @throws SecurityException%0A%09 *             is thrown if a security manager says no.%0A%09 * @throws IllegalArgumentException%0A%09 *             is thrown if an illegal or inappropriate argument has been%0A%09 *             passed to a method.%0A%09 * @throws IllegalAccessException%0A%09 *             is thrown if an illegal on create an instance or access a%0A%09 *             method.%0A%09 */%0A%09@Test%0A%09public void testSetFieldValue() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException%0A%09%7B%0A%09%09String expected;%0A%09%09String actual;%0A%09%09Person person = Person.builder()%0A%09%09%09%09.name(%22Alex%22)%0A%09%09%09%09.build();%0A%09%09expected = %22Leo%22;%0A%09%09ReflectionExtensions.setFieldValue(person, %22name%22, %22Leo%22);%0A%09%09actual = person.getName();%0A%09%09AssertJUnit.assertEquals(expected, actual);%0A%09%7D%0A%09%0A%09/**%0A%09 * Test for %7B@link ReflectionExtensions#copyFieldValue(Object, Object, String)%7D.%0A%09 *%0A%09 * @throws NoSuchFieldException%0A%09 *             is thrown if no such field exists.%0A%09 * @throws SecurityException%0A%09 *             is thrown if a security manager says no.%0A%09 * @throws IllegalArgumentException%0A%09 *             is thrown if an illegal or inappropriate argument has been%0A%09 *             passed to a method.%0A%09 * @throws IllegalAccessException%0A%09 *             is thrown if an illegal on create an instance or access a%0A%09 *             method.%0A%09 */%0A%09@Test%0A%09public void testCopyFieldValue() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException %0A%09%7B%0A%09%09String expected;%0A%09%09String actual;%0A%09%09Person alex = Person.builder()%0A%09%09%09%09.name(%22Alex%22)%0A%09%09%09%09.build();%0A%09%09Person nik = Person.builder()%0A%09%09%09%09.name(%22Nik%22)%0A%09%09%09%09.build();%0A%09%09expected = %22Alex%22;%0A%09%09ReflectionExtensions.copyFieldValue(alex, nik, %22name%22);%0A%09%09actual = nik.getName();%0A%09%09AssertJUnit.assertEquals(expected, actual);%0A%09%09%0A%09%7D
 %0A%0A%7D%0A

Update ReflectionExtensionsTest.java