title: Retrieve only static fields declared in Java class
body: <p>I have the following class:</p>
  
  <pre><code>public class Test {
      public static int a = 0;
      public int b = 1;
  }
  </code></pre>
  
  <p>Is it possible to use reflection to get a list of the static fields only? I'm aware I can get an array of all the fields with <code>Test.class.getDeclaredFields()</code>. But it seems there's no way to determine if a <code>Field</code> instance represents a static field or not.</p>