### Question:
SumOfTwoSquares { public static int findNumberOfWays(int value) { if (value < 0) { return 0; } if (value <= 1) { return 1; } int left = 0; int right = (int) Math.sqrt(value); int numberOfWays = 0; while (left <= right) { long sum = (left + 0L) * left + (right + 0L) * right; if (sum < value) { left++; } else if (sum > value) { right--; } else { numberOfWays++; left++; right--; } } return numberOfWays; }  static int findNumberOfWays(int value);  }### Answer:
@Test public void testFindNumberOfWays() { int actual = findNumberOfWays(inputValue); assertThat("Result for value = " + inputValue + " does not match with expected = " + expected, actual, is(expected)); }