simplify and speedup string intern tests to work with java 6 and 7