### Question:
Minute extends RegularTimePeriod implements Serializable { @Override public long getFirstMillisecond() { return this.firstMillisecond; } Minute();  Minute(int minute, Hour hour);  Minute(Date time);  Minute(Date time, TimeZone zone, Locale locale);  Minute(int minute, int hour, int day, int month, int year); Day getDay(); Hour getHour(); int getHourValue(); int getMinute(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod o1); static Minute parseMinute(String s); static final int FIRST_MINUTE_IN_HOUR; static final int LAST_MINUTE_IN_HOUR; }### Answer:
@Test public void testGetFirstMillisecond() { Locale saved = Locale.getDefault(); Locale.setDefault(Locale.UK); TimeZone savedZone = TimeZone.getDefault(); TimeZone.setDefault(TimeZone.getTimeZone("Europe/London")); Minute m = new Minute(43, 15, 1, 4, 2006); assertEquals(1143902580000L, m.getFirstMillisecond()); Locale.setDefault(saved); TimeZone.setDefault(savedZone); }
@Test public void testGetFirstMillisecondWithTimeZone() { Minute m = new Minute(59, 15, 1, 4, 1950); TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles"); Calendar c = new GregorianCalendar(zone); assertEquals(-623289660000L, m.getFirstMillisecond(c)); try { m.getFirstMillisecond(null); fail("NullPointerException should have been thrown on null parameter"); } catch (NullPointerException e) { } }
@Test public void testGetFirstMillisecondWithCalendar() { Minute m = new Minute(40, 2, 15, 4, 2000); GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY); calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt")); assertEquals(955766400000L, m.getFirstMillisecond(calendar)); try { m.getFirstMillisecond(null); fail("NullPointerException should have been thrown on null parameter"); } catch (NullPointerException e) { } }