Created
July 8, 2016 07:50
-
-
Save pkdevel/073e78ae980675eac81624f067fb9114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.transporeon.tpm.core.service.impl; | |
import java.lang.reflect.Field; | |
import org.junit.Before; | |
import org.junit.Test; | |
public final class MagicTest { | |
@Before | |
public void before() { | |
} | |
@Test | |
public void test() throws Exception { | |
System.out.println("Hello World!"); | |
magic(); | |
System.out.println("Hello World!"); | |
System.out.println("Hello chris"); | |
} | |
private static void magic() throws NoSuchFieldException, IllegalAccessException { | |
final Field field = String.class.getDeclaredField("value"); | |
field.setAccessible(true); | |
field.set("Hello World!", "lol".toCharArray()); | |
field.set("Hello chris", "Hello pimmelp".toCharArray()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment