ExtendedChronology extends AssembledChronology { public static DateTime withPeriodStart(DateTime dt) { int div = (dt.getMonthOfYear() % 3); int d = dt.getMonthOfYear() - Math.max(0, ((div == 0 ? 3 : div) - 1)); dt = dt.withMonthOfYear(d); long millis = PeriodType.QUARTER.getComparator().getLowerLimit().getField( getInstance()).roundFloor(dt.getMillis()); return new DateTime(millis); } private  ExtendedChronology(Chronology base); static ExtendedChronology getInstanceUTC(); static ExtendedChronology getInstance(); static ExtendedChronology getInstance(DateTimeZone zone); static int getQuarter(DateTime dt); static DateTime withPeriodStart(DateTime dt); static DateTime withPeriodEnd(DateTime dt); Chronology withUTC(); Chronology withZone(DateTimeZone zone); DurationField quarters(); String toString(); boolean equals(Object obj); int hashCode();  }
@Test public void testWithPeriodStart() { DateTime testDate = new DateTime(2009, 5, 1, 0, 0, 0, 0); DateTime adjustedDate = ExtendedChronology.withPeriodStart(testDate); assertEquals("2009-04-01T00:00:00.000", noZone(adjustedDate.toString())); testDate = new DateTime(2009, 3, 27, 0, 0, 0, 0); adjustedDate = ExtendedChronology.withPeriodStart(testDate); assertEquals("2009-01-01T00:00:00.000", noZone(adjustedDate.toString())); }