### Question:
ConvertNumberToExcelNumber { public static String convert(int n) { if (n <= 0) { throw new IllegalArgumentException("Argument is not positive"); } StringBuilder builder = new StringBuilder(); while (n > 0) { n--; int remainder = n % 26; n /= 26; builder.append((char) (remainder + 65)); } return builder.reverse().toString(); }  static String convert(int n);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testConvertNegativeN() { convert(-1); }
@Test(expected = IllegalArgumentException.class) public void testConvertZeroN() { convert(0); }
@Test public void testConvert() { assertThat(convert(1), is("A")); assertThat(convert(26), is("Z")); assertThat(convert(27), is("AA")); assertThat(convert(52), is("AZ")); assertThat(convert(53), is("BA")); assertThat(convert(54), is("BB")); assertThat(convert(676), is("YZ")); assertThat(convert(702), is("ZZ")); assertThat(convert(703), is("AAA")); }