title: Scala: public static final in a class
body: <p>I'm trying to get a real equivalent for Java's <code>public static final</code> in Scala for using <a href="http://twip.sourceforge.net/howto.html" rel="nofollow noreferrer">TwiP</a>.</p>
  
  <p>Creating a <code>val</code> in an <code>object</code> doesn't work for me, because it's part of a new generated class <code>Example$.class</code> and TwiP can't access it from class <code>Example.class</code>.</p>
  
  <p>Here's an example of a Java Class I'm trying to port to Scala:</p>
  
  <pre><code>public static final String[] MY_STRINGS = { "A", "B", "C" };
  
  @Test
  public void myTest(@Values("MY_STRINGS") String string) {
    ...
  }
  </code></pre>
  
  <p>But I don't know how to port the <code>public static final</code> to Scala. If it's a val in an object like here</p>
  
  <pre><code>@RunWith(classOf[TwiP])
  class Foo {
  
    import Foo.MY_STRINGS
  
    @Test
    def testTwiP(@Values("MY_STRINGS") value: String): Unit = {
      println("I'm testing value " + value + ".")
    }
  
  }
  
  object Foo {
    val MY_STRINGS = Array("A", "B", "C")
  }
  </code></pre>
  
  <p>I only get the following exception:</p>
  
  <pre><code>net.sf.twip.internal.TwipConfigurationError:
  there is no method or field 'MY_STRINGS' named in the @Values annotation of Parameter#1
  </code></pre>
  
  <p>How can I solve the problem using Scala?</p>