RandomProblem004 { public static int sumOfNNumbers1(int n) { int sum = 0; for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { sum += 1; } } return sum; }  static int sumOfNNumbers(int n); static int squareOfANumber(int n); static int sumOfNNumbers1(int n);  }
@Test public void sumOfFirst10NumbersIs55_1() throws Exception { int sum = RandomProblem004.sumOfNNumbers1(10); assertThat(sum, equalTo(55)); }