Java string testing class