@Test(expected = IllegalArgumentException.class) public void valueOf_tooHigh() { Brightness.of(Brightness.MAX_VALUE + 1); }
public static Brightness of(int brightness) { if (brightness < MIN_VALUE || brightness > MAX_VALUE) { throw new IllegalArgumentException("Invalid brightness level : " + brightness + ". Acceptable values are in range [0..15]."); } return CACHE[brightness - MIN_VALUE]; }
Brightness { public static Brightness of(int brightness) { if (brightness < MIN_VALUE || brightness > MAX_VALUE) { throw new IllegalArgumentException("Invalid brightness level : " + brightness + ". Acceptable values are in range [0..15]."); } return CACHE[brightness - MIN_VALUE]; } }
Brightness { public static Brightness of(int brightness) { if (brightness < MIN_VALUE || brightness > MAX_VALUE) { throw new IllegalArgumentException("Invalid brightness level : " + brightness + ". Acceptable values are in range [0..15]."); } return CACHE[brightness - MIN_VALUE]; } private  Brightness(int brightness); }
Brightness { public static Brightness of(int brightness) { if (brightness < MIN_VALUE || brightness > MAX_VALUE) { throw new IllegalArgumentException("Invalid brightness level : " + brightness + ". Acceptable values are in range [0..15]."); } return CACHE[brightness - MIN_VALUE]; } private  Brightness(int brightness); static Brightness of(int brightness); int getBrightness(); Brightness more(); Brightness less(); @Override boolean equals(Object o); @Override int hashCode(); }
Brightness { public static Brightness of(int brightness) { if (brightness < MIN_VALUE || brightness > MAX_VALUE) { throw new IllegalArgumentException("Invalid brightness level : " + brightness + ". Acceptable values are in range [0..15]."); } return CACHE[brightness - MIN_VALUE]; } private  Brightness(int brightness); static Brightness of(int brightness); int getBrightness(); Brightness more(); Brightness less(); @Override boolean equals(Object o); @Override int hashCode(); static final int MIN_VALUE; static final int MAX_VALUE; static final Brightness BRIGHTNESS_MIN; static final Brightness BRIGHTNESS_MAX; }