### Question:
LunarUtil { static int[] solarToLunar(int year, int month, int day) { int[] lunarInt = new int[4]; int index = year - SOLAR[0]; int data = (year << 9) | (month << 5) | (day); int solar11; if (SOLAR[index] > data) { index--; } solar11 = SOLAR[index]; int y = getBitInt(solar11, 12, 9); int m = getBitInt(solar11, 4, 5); int d = getBitInt(solar11, 5, 0); long offset = solarToInt(year, month, day) - solarToInt(y, m, d); int days = LUNAR_MONTH_DAYS[index]; int leap = getBitInt(days, 4, 13); int lunarY = index + SOLAR[0]; int lunarM = 1; int lunarD; offset += 1; for (int i = 0; i < 13; i++) { int dm = getBitInt(days, 1, 12 - i) == 1 ? 30 : 29; if (offset > dm) { lunarM++; offset -= dm; } else { break; } } lunarD = (int) (offset); lunarInt[0] = lunarY; lunarInt[1] = lunarM; lunarInt[3] = 0; if (leap != 0 && lunarM > leap) { lunarInt[1] = lunarM - 1; if (lunarM == leap + 1) { lunarInt[3] = 1; } } lunarInt[2] = lunarD; return lunarInt; }  static String getLunarMonth(int month); static String getLunarDay(int day);  }### Answer:
@Test public void solarToLunar() throws Exception { int[] lunar = LunarUtil.solarToLunar(2018, 3, 5); assertEquals(lunar[0], 2018); assertEquals(lunar[1], 1); assertEquals(lunar[2], 18); assertEquals("", LunarUtil.getLunarHoliday(lunar[0], lunar[1], lunar[2])); lunar = LunarUtil.solarToLunar(2018, 3, 2); assertEquals(lunar[0], 2018); assertEquals(lunar[1], 1); assertEquals(lunar[2], 15); assertEquals("元宵节", LunarUtil.getLunarHoliday(lunar[0], lunar[1], lunar[2])); assertEquals("惊蛰", LunarUtil.getSolarTerm(2018, 3,5)); assertEquals("夏至", LunarUtil.getSolarTerm(2017, 6,21)); }