title: enum in separate class
body: <p>Is there anyway to put this test in a separate class? I tried but was unsuccessful.</p>
  
  <pre><code>public class TrafficLightprj 
  {
      public enum TrafficLight 
      {  
          RED(1),  
          GREEN(2),  
          YELLOW(3);
  
          private final int duration; 
  
          TrafficLight(int duration) { 
              this.duration = duration; 
          }  
  
          public int getDuration() { 
              return this.duration; 
          } 
  
  
          public static void main(String[] args) 
          {
              for(TrafficLight light: TrafficLight.values())
              {
                 System.out.println("The traffic light value is: " +light);
                 System.out.println("The duration of that trafic light value is: " + light.getDuration());
              }
          }   
      }
  }
  </code></pre>