class IdentifiableObjectUtils {

    public static Period getPeriodByPeriodType( Period period, PeriodType periodType, Calendar calendar )
    {
        Assert.isTrue( periodType.getFrequencyOrder() >= period.getPeriodType().getFrequencyOrder(), 
            "Frequency order of period type must be greater than or equal to period" );
        
        Date date = period.getStartDate();
                
        if ( WeeklyAbstractPeriodType.class.isAssignableFrom( period.getPeriodType().getClass() ) )
        {
            date = new DateTime( date.getTime() ).plusDays( 3 ).toDate();
        }
        
        return periodType.createPeriod( date, calendar );
    }

}