오늘은 어디로 갈까...

음력(LunaDate) 본문

낙서

음력(LunaDate)

剛宇 2009. 3. 1. 11:46
양력을 음력으로 변환하는 클래스를 만들어보자.

간단히 말해서 음력은 달을 기준으로 달이 지구 둘레를 한바퀴 도는 공전 기간을 달로 만든것이고,
양력은 태양을 기준으로 지구가 태양을 한바퀴 도는 공전 기간을 년으로 만듯것이다.
이 음력과 양력을 변환하는것은 천문학적인 복잡한 계산이 필요하다고 한다.(천문학이라서 천문학적인가...)
그래서 우리같은 범인들은 음양력 변환을 위해서, 아주 간단한 방법을 사용한다. 음력과 양력 기준일을 정해서 그 차이만큼 더하고 빼는것이다.
예를들면 양력 1991년 1월 1일은 음력 1900년 11월 11일(평달)이다. 그러면 양력 1991년 1월 3일은 음력으로 몇일일까?
음력 1900년 11월 13일(평달)일것이다. 양력에 2일을 더한것이나 음력에 2일을 더하면 그 값이 해당일의 음력일일것이다.
그런데 문제는 이 음력의 달수를 간단한 공식으로 구할 수가 없다는것이다. 그래서 대부분 상수로 정의해서 달수를 구하게 된다.
우리나라 달력의 모든 자료는 한국천문연구원(http://www.kasi.re.kr/)에서 정한 것이 기준이 됩니다.
이 한국천문연구원에서 음력 상수를 제공해주면 좋은데, 상당히 비협조적이다.
그래서 이곳에서 발행한 만세력을 참조해서 직접 만들어야한다.
LunaDateConstants 란 이름으로 한번 만들어 보자.. --;
package kr.kangwoo.util.date;

/**
 * <p>음력 관련 상수가 선언된 인터페이스입니다.</p>
 * <p>현재 1799년 부터 2100년 까지의 음력달수 데이터가 선언되어있습니다.</p> 
 * 
 * @author <a href="mailto:kangwoo@jarusoft.com">kangwoo</a>
 * @version 1.0
 * @since 1.0
 */
public interface LunaDateConstants {
	
	public static final String[] HANJA_GAN = {"甲","乙","丙","丁","戊","己","庚","辛","壬","癸"};
	public static final String[] HANJA_JEE = {"子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"};
	public static final String[] HANGUL_DDI = {"쥐","소","범","토끼","용","뱀","말","양","원숭이","닭","개","돼지"};
	
	/**
	 * <p>음력달 데이터</p>
	 * <pre>
	 * 1 : 평달 / 작은달
	 * 2 : 평달 / 큰달
	 * 3 : 윤달일 있는 달 / 평달이 작고 윤달도 작다
	 * 4 : 윤달일 있는 달 / 평달이 작고 윤달이 크다
	 * 5 : 윤달일 있는 달 / 평달이 크고 윤달이 작다
	 * 6 : 윤달일 있는 달 / 평달과 윤달이 모두 크다
	 * </pre>
	 */
	public static final int[][] LUNA_MONTH_TABLE = {
    	{1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2},
    	{2, 1, 2, 5, 2, 1, 2, 1, 2, 1, 2, 1},
    	{1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2}, /* 1801 */ 
    	{1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1},
    	{2, 3, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2},
    	{1, 2, 1, 2, 1, 3, 2, 1, 2, 2, 2, 1},
    	{2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1},
    	{2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2},
    	{1, 2, 2, 1, 5, 2, 1, 2, 1, 1, 2, 1},
    	{2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2},
    	{1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2},
    	{1, 1, 5, 2, 1, 2, 2, 1, 2, 2, 1, 2}, /* 1811 */
    	{1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1},
    	{2, 5, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2},
    	{2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1},
    	{2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2},
    	{1, 2, 1, 5, 2, 2, 1, 2, 2, 1, 2, 1},
    	{1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2},
    	{1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2}, /* 1821 */
    	{2, 1, 5, 1, 1, 2, 1, 2, 2, 1, 2, 2},
    	{2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 1, 2, 3, 2, 1, 2, 2, 1, 2, 2, 2},
    	{1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2}, /* 1831 */
    	{1, 2, 1, 2, 1, 1, 2, 1, 5, 2, 2, 2},
    	{1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 5, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2},
    	{1, 2, 1, 5, 1, 2, 2, 1, 2, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 4, 1, 1, 2, 1, 2, 1, 2, 2, 1},   /* 1841 */
    	{2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1},
    	{2, 2, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1},
    	{2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 5, 2, 1, 2, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 2, 1, 1, 2, 3, 2, 1, 2, 2},   /* 1851 */
    	{2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2},
    	{1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2},
    	{1, 2, 1, 1, 5, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2},
    	{2, 1, 6, 1, 1, 2, 1, 1, 2, 1, 2, 2},
    	{1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2},   /* 1861 */
    	{2, 1, 2, 1, 2, 2, 1, 5, 2, 1, 1, 2},
    	{1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2},
    	{1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 1, 2, 4, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2},
    	{1, 2, 2, 3, 2, 1, 1, 2, 1, 2, 2, 1},
    	{2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 2, 2, 1, 2, 1, 2, 1, 1, 5, 2, 1},
    	{2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2},   /* 1871 */
    	{1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2},
    	{1, 1, 2, 1, 2, 4, 2, 1, 2, 2, 1, 2},
    	{1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1},
    	{2, 2, 1, 1, 5, 1, 2, 1, 2, 2, 1, 2},
    	{2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 2, 4, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2},
    	{1, 2, 1, 2, 1, 2, 5, 2, 2, 1, 2, 1},   /* 1881 */
    	{1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2},
    	{2, 1, 1, 2, 3, 2, 1, 2, 2, 1, 2, 2},
    	{2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 2, 1, 5, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2},
    	{1, 5, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2},   /* 1891 */
    	{1, 1, 2, 1, 1, 5, 2, 2, 1, 2, 2, 2},
    	{1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 2, 1},
    	{2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 5, 2, 2, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 5, 2, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1},   /* 1901 */
    	{2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 2, 3, 2, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1},
    	{2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2},
    	{1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1},
    	{2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2},
    	{1, 5, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 1, 1, 5, 1, 2, 2, 1, 2, 2},   /* 1911 */
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2},
    	{2, 2, 1, 2, 5, 1, 2, 1, 2, 1, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1},
    	{2, 3, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 2, 1, 1, 2, 1, 5, 2, 1, 2, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2},   /* 1921 */
    	{2, 1, 2, 2, 3, 2, 1, 1, 2, 1, 2, 2},
    	{1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2},
    	{2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1},
    	{2, 1, 2, 5, 2, 1, 2, 2, 1, 2, 1, 2},
    	{1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 5, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2},
    	{1, 2, 2, 1, 1, 5, 1, 2, 1, 2, 2, 1},
    	{2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1},   /* 1931 */
    	{2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2},
    	{1, 2, 2, 1, 6, 1, 2, 1, 2, 1, 1, 2},
    	{1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2},
    	{1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 4, 1, 1, 2, 2, 1, 2, 2, 2, 1},
    	{2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1},
    	{2, 2, 1, 1, 2, 1, 4, 1, 2, 2, 1, 2},
    	{2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 2, 1, 2, 2, 4, 1, 1, 2, 1, 2, 1},   /* 1941 */
    	{2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 4, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2},
    	{2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2},
    	{2, 5, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 1, 2, 2, 1, 2, 3, 2, 1, 2, 1, 2},
    	{1, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2},   /* 1951 */
    	{1, 2, 1, 2, 4, 1, 2, 2, 1, 2, 1, 2},
    	{1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2},
    	{1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2},
    	{2, 1, 4, 1, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 1, 5, 2, 1, 2, 2},
    	{1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2},   /* 1961 */
    	{1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2},
    	{1, 2, 5, 2, 1, 1, 2, 1, 1, 2, 2, 1},
    	{2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 2, 1, 5, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2},
    	{1, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1, 2},   /* 1971 */
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 5, 1, 2, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2},
    	{2, 2, 1, 2, 1, 2, 1, 5, 1, 2, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1},
    	{2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 6, 1, 2, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2},   /* 1981 */
    	{2, 1, 2, 3, 2, 1, 1, 2, 1, 2, 2, 2},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2},
    	{2, 1, 2, 2, 1, 1, 2, 1, 1, 5, 2, 2},
    	{1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1},
    	{2, 1, 2, 1, 2, 5, 2, 2, 1, 2, 1, 2},
    	{1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 1, 5, 1, 2, 2, 1, 2, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2},   /* 1991 */
    	{1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2},
    	{1, 2, 5, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 1, 2, 5, 2, 1, 1, 2},
    	{1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1},
    	{2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 1, 2, 3, 2, 2, 1, 2, 2, 2, 1},
    	{2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1},
    	{2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1},
    	{2, 2, 1, 5, 2, 1, 1, 2, 1, 2, 1, 2},   /* 2001 */
    	{2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2},
    	{1, 5, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 1, 5, 2, 2, 1, 2, 2},
    	{1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2},
    	{2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2},
    	{2, 2, 1, 1, 5, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1},   /* 2011 */
    	{2, 1, 2, 5, 2, 2, 1, 1, 2, 1, 2, 1},
    	{2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1},
    	{2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2},
    	{2, 1, 2, 5, 2, 1, 1, 2, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1},   /* 2021 */
    	{2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2},
    	{1, 5, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1},
    	{2, 2, 2, 1, 5, 1, 2, 1, 1, 2, 2, 1},
    	{2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2},
    	{1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 5, 2, 1, 2, 2, 1, 2, 1, 2, 1},   /* 2031 */
    	{2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 5, 2},
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 2, 1, 4, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2},
    	{2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1},
    	{2, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1, 1},
    	{2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2},   /* 2041 */
    	{1, 5, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2},
    	{2, 1, 2, 1, 1, 2, 3, 2, 1, 2, 2, 2},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2},
    	{2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2},
    	{2, 1, 2, 2, 4, 1, 2, 1, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1},
    	{2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1},
    	{1, 2, 4, 1, 2, 1, 2, 2, 1, 2, 2, 1}, 
    	{2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2},   /* 2051 */
    	{1, 2, 1, 1, 2, 1, 1, 5, 2, 2, 2, 2},
    	{1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2},
    	{1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2},
    	{1, 2, 2, 1, 2, 4, 1, 1, 2, 1, 2, 1},
    	{2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2},
    	{1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1},
    	{2, 1, 2, 4, 2, 1, 2, 1, 2, 2, 1, 1},
    	{2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1},
    	{2, 2, 3, 2, 1, 1, 2, 1, 2, 2, 2, 1},   /* 2061 */
    	{2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1},
    	{2, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2},
    	{2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2},
    	{1, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2},
    	{1, 2, 1, 5, 1, 2, 1, 2, 2, 2, 1, 2},
    	{2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2},
    	{2, 1, 2, 1, 2, 1, 1, 5, 2, 1, 2, 2},   /* 2071 */
    	{2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2},
    	{2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1},
    	{2, 1, 2, 2, 1, 5, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1},
    	{2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 1},
    	{2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2},
    	{1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{2, 1, 5, 2, 1, 1, 2, 1, 2, 1, 2, 2},
    	{1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2},   /* 2081 */
    	{1, 2, 2, 2, 1, 2, 3, 2, 1, 1, 2, 2},
    	{1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1},
    	{2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2},
    	{1, 2, 1, 1, 6, 1, 2, 2, 1, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1},
    	{2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2},
    	{1, 2, 1, 5, 1, 2, 1, 1, 2, 2, 2, 1},
    	{2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1},
    	{2, 2, 2, 1, 2, 1, 1, 5, 1, 2, 2, 1},
    	{2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1},   /* 2091 */
    	{2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1},
    	{1, 2, 2, 1, 2, 4, 2, 1, 2, 1, 2, 1},
    	{2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2},
    	{1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1},
    	{2, 1, 2, 3, 2, 1, 1, 2, 2, 2, 1, 2},
    	{2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2},
    	{2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2},
    	{2, 5, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2},
    	{2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1},
    	{2, 2, 1, 2, 2, 1, 5, 2, 1, 1, 2, 1}};

	public static int[][] DAYS_OF_MONTH = {
    	{29}, {30}, {29, 29}, {29, 30}, {30, 29}, {30, 30}
    };
    
	public static final int LUNA_BEGIN_YEAR = 1799;
	public static final int LUNA_END_YEAR = 1799 - 1 + LUNA_MONTH_TABLE.length;

}


이 상수 테이블은 인터넷에 돌아다니는것을 조합하고 개인적으로 오류를 수정해서 만든것임을 밝혀둔다.
수 많은 표본(?)을 토대로 만든것이라서 원저작자를 표시못함을 이해해주기 바란다.
그리고, 이 테이블이 정확하다고는 보장을 못해겠으니, 알아서 판단하자.


자, 그럼 음력(LunaDate) 클래스를 만들어보자.
맨 먼저 기준일은 양력 1801년 1월 1일로 정하고 년/월/일을 저장할 수 있게 만들자
package kr.kangwoo.util.date;

import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;

import kr.kangwoo.util.DateUtils;
import kr.kangwoo.util.MessageUtils;

public class LunaDate implements LunaDateConstants {

    // 양/음력 기준일
    private static final Date SOLRA_FIXED_DATE = DateUtils.toDate(1801, 1, 1);
    private static final LunaDate LUNA_FIXED_DATE = new LunaDate(1800, 11, 17, false);
    
    // 속도 향상을 위한 캐시
    private static final Object[][] CACHE = {
    	{1851, DateUtils.toDate(1851, 1, 1), 1850, new LunaDate(1850, 11, 29, false)},
    	{1901, DateUtils.toDate(1901, 1, 1), 1900, new LunaDate(1900, 11, 11, false)},
    	{1951, DateUtils.toDate(1951, 1, 1), 1950, new LunaDate(1950, 11, 24, false)},
    	{2001, DateUtils.toDate(2001, 1, 1), 2000, new LunaDate(2000, 12,  7, false)},
    };
    
    private int year;
    private int month;
    private int day;
    private boolean isLeaf;	// 윤달여부
    
    private int gan;	// 천간
    private int jee;	// 지지
    private int ddi;	// 띠

    /**
     * <p>음력일 생성자이다.</p>
     * 
     * @param year 음력의 년(1799~2100)
     * @param month 음력의 월(1~12)
     * @param day 음력의 일
     * @param isLeaf 음력의 윤달여부
     */
    public LunaDate(int year, int month, int day, boolean isLeaf) {
    	setYear(year);
        setMonth(month, isLeaf);
        setDay(day);
    }

    /**
     * <p>음력일 생성자이다.</p>
     * 
     * @param dateStr 음력 문자열
     * @param pattern 입력 문자열의 패턴
     * @param isLeaf 음력의 윤달여부
     * @throws ParseException 음력 문자열 분석 실패시
     */
    public LunaDate(String dateStr, String pattern, boolean isLeaf) throws ParseException {
    	Date date = DateUtils.toDate(dateStr, pattern);
    	setYear(DateUtils.getYear(date));
    	setMonth(DateUtils.getMonth(date), isLeaf);
    	setDay(DateUtils.getDay(date));
    }
	
    /**
     * <p>음력일 생성자이다.</p>
     * 
     * @param dateStr 음력 문자열
     * @param isLeaf 음력의 윤달여부
     * @throws ParseException 음력 문자열 분석 실패시
     */
    public LunaDate(String dateStr, boolean isLeaf) throws ParseException {
    	if (dateStr == null) {
    		throw new IllegalArgumentException(MessageUtils.format("Illegal Argument Date String \"{}\"", dateStr));
    	}
    	Date date = DateUtils.toDate(dateStr);
    	setYear(DateUtils.getYear(date));
    	setMonth(DateUtils.getMonth(date), isLeaf);
    	setDay(DateUtils.getDay(date));
    }

    /**
     * <p>년도를 설정합니다.</p>
     * 
     * @param year 설정하려는 년도(1799~2100).
     */
    protected void setYear(int year) {
    	if (year < (LUNA_BEGIN_YEAR + 1) && year > (LUNA_END_YEAR - 1)) {
    		throw new IllegalArgumentException("가능한 연도 범위는 " + (LUNA_BEGIN_YEAR + 1) + " ~ " + (LUNA_END_YEAR - 1) + " 까지입니다.");
    	}
        this.year = year;
        this.gan = (year+6) % 10;
        this.jee = (year+8) % 12;
        this.ddi = (year+8) % 12;
    }
 
    /**
     * <p>월을 설정합니다.</p>
     * 
     * @param month 설정하려는 월(1~12).
     */
    protected void setMonth(int month, boolean isLeaf) {
    	if (month < 1 || month > 12) {
    		throw new IllegalArgumentException("가능한 월 범위는 1 ~ 12 까지입니다.");	
    	}
    	// 윤달 가능 여부 검사
    	if (isLeaf) {
    		if (getDaysOfMonthByIndex(year - LUNA_BEGIN_YEAR, month - 1).length != 2) {
    			throw new IllegalArgumentException(MessageUtils.format("{0}년 {1}월은 윤달이 존재하지 않습니다.", year, month));	
    		}
    	}

        this.month = month;
        this.isLeaf = isLeaf;
        
    }

    /**
     * <p>일을 설정합니다.</P>
     * 
     * @param day 설정하려는 일.
     */
    protected void setDay(int day) {
    	int[] daysOfMonth = getDaysOfMonthByIndex(year - LUNA_BEGIN_YEAR, month - 1);
    	int maxDay = isLeaf ? daysOfMonth[1] : daysOfMonth[0];
    	if (day > maxDay || day < 1) {
    		throw new IllegalArgumentException(MessageUtils.format("{0}년 {1}월({2}달)은 1일부터 {3}일까지만 존재합니다.({4})", year, month, (isLeaf ? "윤" : "평"), maxDay, day));
    	}
        this.day = day;
    }  
    
    /**
     * <p>해당 년, 월의 일수를 가져옵니다.</p>
     * 
     * @param yearIndex 년 인덱스(0부터 시작)
     * @param monthIndex 월 인덱스(0부터 시작)
     * @return
     */
    public static int[] getDaysOfMonthByIndex(int yearIndex, int monthIndex) {
    	return DAYS_OF_MONTH[LUNA_MONTH_TABLE[yearIndex][monthIndex] - 1];
    }
    
    /**
     * <p>해당 년, 월의 일수를 가져옵니다.</p>
     * 
     * @param year 년
     * @param month 월
     * @return
     */
    public static int[] getDaysOfMonth(int year, int month) {
    	return getDaysOfMonthByIndex(year - LUNA_BEGIN_YEAR, month - 1);
    }
    
    /**
     * <p>해당 년의 일수를 가져옵니다.</p>
     * 
     * @param yearIndex 년 인덱스(0부터 시작)
     * @return
     */
    public static int getDaysOfYearByIndex(int yearIndex) {
    	int daysOfYear = 0;
    	int[] daysOfMonth = null;
    	for (int i = 0; i < 12; i++) {
    		daysOfMonth = getDaysOfMonthByIndex(yearIndex, i);
    		daysOfYear += daysOfMonth[0];
    		if (daysOfMonth.length > 1) {
    			daysOfYear += daysOfMonth[1];
    		}
    	}
    	return daysOfYear;
    }

    /**
     * <p>해당 년의 일수를 가져옵니다.</p>
     * 
     * @param yearIndex 년
     * @return
     */
    public static int getDaysOfYear(int year) {
    	return getDaysOfYearByIndex(year - LUNA_BEGIN_YEAR);
    }
}

기준일 선언하는 부분을 보면 CACHE 라고 다중(?) 기준일을 선언해놨다. 기준일이 1800년일때 2000년도의 음력을 구할라면 대충 200년*365일을 더해줘야함으로 많은 연산이 발생한다. 이 연산을 줄이기 위해 기준일을 여러개 선언해서 가장 가까운 기준일을 선택해서 계산하면 좀 더 빠를것이다.(요즘은 성능이 워낙좋아서 거의 차이가 안날지도 --;)

자, 그러면 양력을 음력으로 변환하는 메소드를 만들어보자.
    /**
     * <p>양력을 음력으로 변환한다.</p>
     * 
     * @param solraDate 양력
     * @return 음력
     */
    public static LunaDate toLunaDate(Date solraDate) {
    	int year = DateUtils.getYear(solraDate);
    	Date solraFixedDate = null;
    	LunaDate lunaFixedDate = null;
    	for (int i = CACHE.length - 1; i >= 0; i--) {
    		if ((Integer)CACHE[i][0] < year) {
    			solraFixedDate = (Date)CACHE[i][1];
    			lunaFixedDate = (LunaDate)CACHE[i][3];
    			break;
    		}
    	}
    	if (solraFixedDate == null || lunaFixedDate == null) {
			solraFixedDate = SOLRA_FIXED_DATE;
			lunaFixedDate = LUNA_FIXED_DATE;
    	}
    	LunaDate lunaDate = (LunaDate)lunaFixedDate.clone();
    	lunaDate.addDays(DateUtils.getDaysBetween(solraFixedDate, solraDate));
    	return lunaDate;
    }

앞에서 설명한봐와 같이, 가장 적합한 기준일울 정한다음, 그 기준일로부터 차이를 구해서 반영하는것이다. 그러면 음력 클래스에 일(day)의 차이를 반영해주는 addDays(int) 메소드를 만들어보자.
    /**
     * <p>해당 일수만큼 더하거나 뺍니다.</p>
     * 
     * @param days 일수
     * @return
     */
    public LunaDate addDays(int days) {
    	if (days > 0) {
    		return afterDays(days);
    	} else if (days < 0) {
    		return beforeDays(0 - days);
    	}
    	return this;
    }
    
    /**
     * <p>해당 일수 만큼 더한 날짜를 구합니다.</p>
     * 
     * @param days
     * @return
     */
	public LunaDate afterDays(int days) {
		if (days < 0) {
			return beforeDays(0 - days);
		}
		
		int tmpDays = day + days;
		boolean tmpIsLeaf = isLeaf;
		
		boolean notFinished = true;
		int[] daysOfMonth = null;
		int i = year - LUNA_BEGIN_YEAR;
		int j = month - 1;
		// 처음 한번 윤달 보정
		if (tmpIsLeaf) {
			daysOfMonth = getDaysOfMonthByIndex(i, j);
			tmpDays += daysOfMonth[0];
		}
        for (	; (i < LUNA_MONTH_TABLE.length) && (notFinished); i++) {
            for (	; (j < 12) && (notFinished); j++) {
            	tmpIsLeaf = false;
            	daysOfMonth = getDaysOfMonthByIndex(i, j);
                if (tmpDays > daysOfMonth[0]) {
                	tmpDays = tmpDays - daysOfMonth[0];
                	if (daysOfMonth.length > 1) {
                		if (tmpDays > daysOfMonth[1]) {
                    		tmpDays = tmpDays - daysOfMonth[1];
                		} else {
                			tmpIsLeaf = true;
                        	setYear(i + LUNA_BEGIN_YEAR);
                        	setMonth(j + 1, tmpIsLeaf);
                        	setDay(tmpDays);
                        	notFinished = false;
                    	}
                	} 
                } else {
                	setYear(i + LUNA_BEGIN_YEAR);
                	setMonth(j + 1, tmpIsLeaf);
                	setDay(tmpDays);
                	notFinished = false;
                }
            } // end for j
            j = 0;
        }
        
    	if (notFinished) {
    		throw new IllegalArgumentException("계산 가능한 날짜 범위를 벗어났습니다. (" + (LUNA_BEGIN_YEAR + 1) + "0101~" + (LUNA_END_YEAR - 1) + "12DD)");
    	}
        return this;
	}
	
	/**
	 * <p>해당 일수 만큼 뺀 날짜를 구합니다.</p>
	 * 
	 * @param days
	 * @return
	 */
	public LunaDate beforeDays(int days) {
		if (days < 0) {
			return afterDays(0 - days);
		}
		
		int tmpDays = day - days;
		boolean tmpIsLeaf = isLeaf;
		
		int[] daysOfMonth = null;
		int i = year - LUNA_BEGIN_YEAR;
		int j = month - 1 - 1;
		
		// 처음 한번 윤달 보정
		if (tmpIsLeaf == false) {
			daysOfMonth = getDaysOfMonthByIndex(i, j);
			if (daysOfMonth.length > 1) {
				tmpDays -= daysOfMonth[1];	
			}
		}
		int tmpYear = year;
		int tmpMonth = month;
		int tmpDay = tmpDays;
        for (	; (i >= 0) && (tmpDays < 1); i--) {
            for (	; (j >= 0) && (tmpDays < 1); j--) {
            	tmpIsLeaf = false;
            	daysOfMonth = getDaysOfMonthByIndex(i, j);
            	if (daysOfMonth.length > 1) {
            		tmpDays += daysOfMonth[1];
            		if (tmpDays > 0) {
            			tmpIsLeaf = true;
            			tmpYear = i + LUNA_BEGIN_YEAR;
            			tmpMonth = j + 1;
            			tmpDay = tmpDays;
            		} else {
            			tmpDays += daysOfMonth[0];
            			if (tmpDays > 0) {
                			tmpYear = i + LUNA_BEGIN_YEAR;
                			tmpMonth = j + 1;
                			tmpDay = tmpDays;
            			}
            		}
            	} else {
            		tmpDays += daysOfMonth[0];
        			if (tmpDays > 0) {
            			tmpYear = i + LUNA_BEGIN_YEAR;
            			tmpMonth = j + 1;
            			tmpDay = tmpDays;
        			}
            	}

            } // end for j
        	j = 11;
        }
        
    	if (tmpDay < 1) {
    		throw new IllegalArgumentException("계산 가능한 날짜 범위를 벗어났습니다. (" + (LUNA_BEGIN_YEAR + 1) + "0101~" + (LUNA_END_YEAR - 1) + "12DD)");
    	}
        
    	setYear(tmpYear);
    	setMonth(tmpMonth, tmpIsLeaf);
    	setDay(tmpDay);
        return this;
	}

특별한 알고리즘 없이, 그저 단순하게 음력 달의 수를 가져와서 알맞게 빼거나 더해서 차이만큼 반영해준다. 제대로 작동하는지 한번 테스트해볼까. 테스트한 사용한 음력-양력 자료는 한국천문연구원의 음양력변환페이지에서 추출하였다.
	@Test
	public void testEqualsObject() {
		LunaDate lDate1 = new LunaDate(1978, 6, 15, false);
		LunaDate lDate2 = new LunaDate(1978, 6, 15, false);
		
		Assert.assertEquals(lDate1.getYear(), lDate2.getYear());
		Assert.assertEquals(lDate1.getMonth(), lDate2.getMonth());
		Assert.assertEquals(lDate1.getDay(), lDate2.getDay());
		Assert.assertEquals(lDate1.isLeaf(), lDate2.isLeaf());
		Assert.assertEquals(lDate1.getGan(), lDate2.getGan());
		Assert.assertEquals(lDate1.getJee(), lDate2.getJee());
		Assert.assertEquals(lDate1.getDdi(), lDate2.getDdi());
	}
	
	@Test
	public void testClone() {
		LunaDate lDate1 = new LunaDate(1978, 6, 15, false);
		LunaDate lDate2 = (LunaDate)lDate1.clone();
		
		Assert.assertEquals(lDate1.getYear(), lDate2.getYear());
		Assert.assertEquals(lDate1.getMonth(), lDate2.getMonth());
		Assert.assertEquals(lDate1.getDay(), lDate2.getDay());
		Assert.assertEquals(lDate1.isLeaf(), lDate2.isLeaf());
		Assert.assertEquals(lDate1.getGan(), lDate2.getGan());
		Assert.assertEquals(lDate1.getJee(), lDate2.getJee());
		Assert.assertEquals(lDate1.getDdi(), lDate2.getDdi());
	}

	@Test
	public void testToLunaDateDate() {
		LunaDate lDate = new LunaDate(1978, 6, 15, false);
		LunaDate lDate2 = LunaDate.toLunaDate(DateUtils.toDate("1978-07-19"));

		Assert.assertEquals(lDate.getYear(), lDate2.getYear());
		Assert.assertEquals(lDate.getMonth(), lDate2.getMonth());
		Assert.assertEquals(lDate.getDay(), lDate2.getDay());
		Assert.assertEquals(lDate.isLeaf(), lDate2.isLeaf());
		
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(1800,  1,  1)), new LunaDate(1799, 12, 07, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(1800, 12, 31)), new LunaDate(1800, 11, 16, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(1801,  1,  1)), new LunaDate(1800, 11, 17, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(1802,  1,  1)), new LunaDate(1801, 11, 27, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(1850, 12, 31)), new LunaDate(1850, 11, 28, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(2050, 12, 31)), new LunaDate(2050, 11, 18, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(2009,  3,  1)), new LunaDate(2009,  2,  5, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(2006,  8, 12)), new LunaDate(2006,  7, 19, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(2006,  9, 11)), new LunaDate(2006,  7, 19, true));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(2005,  1,  1)), new LunaDate(2004, 11, 21, false));
		Assert.assertEquals(LunaDate.toLunaDate(DateUtils.toDate(1975,  4, 11)), new LunaDate(1975,  2, 30, false));
	}

다행이 정상적으로 돌아가는거 같다.