@Test
public void createYear() throws Exception {

    // test all 3 ways to create a year
    DateTimePeriod period0 = DateTimePeriod.createYear(2009, DateTimeZone.UTC);
    DateTimePeriod period1 = DateTimePeriod.createYear(new DateTime(2009,1,1,0,0,0,0,DateTimeZone.UTC));
    DateTimePeriod period2 = DateTimePeriod.create(DateTimeDuration.YEAR, new DateTime(2009,1,1,0,0,0,0,DateTimeZone.UTC));
    DateTime correctStart = new DateTime(2009,1,1,0,0,0,0,DateTimeZone.UTC);
    DateTime correctEnd = new DateTime(2010,1,1,0,0,0,0,DateTimeZone.UTC);
    Assert.assertEquals(correctStart, period0.getStart());
    Assert.assertEquals(correctEnd, period0.getEnd());
    Assert.assertEquals(DateTimeDuration.YEAR, period0.getDuration());
    Assert.assertEquals("2009", period0.getKey());
    Assert.assertEquals("2009", period0.getLongName());
    Assert.assertEquals("2009", period0.getShortName());
    Assert.assertEquals("2009", period0.getIndexName());
    Assert.assertEquals(correctStart, period1.getStart());
    Assert.assertEquals(correctEnd, period1.getEnd());
    Assert.assertEquals(DateTimeDuration.YEAR, period1.getDuration());
    Assert.assertEquals("2009", period1.getKey());
    Assert.assertEquals("2009", period0.getLongName());
    Assert.assertEquals("2009", period0.getShortName());
    Assert.assertEquals("2009", period0.getIndexName());
    Assert.assertEquals(correctStart, period2.getStart());
    Assert.assertEquals(correctEnd, period2.getEnd());
    Assert.assertEquals(DateTimeDuration.YEAR, period2.getDuration());
    Assert.assertEquals("2009", period2.getKey());
    Assert.assertEquals("2009", period0.getLongName());
    Assert.assertEquals("2009", period0.getShortName());
    Assert.assertEquals("2009", period0.getIndexName());
}