@Test public void extractPositiveDoubleShouldReturnZeroWhenZeroLimit() { String parameterName = "param"; Request request = mock(Request.class); when(request.queryParams(parameterName)) .thenReturn("0"); Optional<Double> result = ParametersExtractor.extractPositiveDouble(request, parameterName); assertThat(result).contains(0d); }
public static Optional<Double> extractPositiveDouble(Request request, String parameterName) { return extractPositiveNumber(request, parameterName, Double::valueOf); }
ParametersExtractor { public static Optional<Double> extractPositiveDouble(Request request, String parameterName) { return extractPositiveNumber(request, parameterName, Double::valueOf); } }
ParametersExtractor { public static Optional<Double> extractPositiveDouble(Request request, String parameterName) { return extractPositiveNumber(request, parameterName, Double::valueOf); }  }
ParametersExtractor { public static Optional<Double> extractPositiveDouble(Request request, String parameterName) { return extractPositiveNumber(request, parameterName, Double::valueOf); }  static Limit extractLimit(Request request); static Offset extractOffset(Request request); static Optional<Double> extractPositiveDouble(Request request, String parameterName); static Optional<Integer> extractPositiveInteger(Request request, String parameterName); }
ParametersExtractor { public static Optional<Double> extractPositiveDouble(Request request, String parameterName) { return extractPositiveNumber(request, parameterName, Double::valueOf); }  static Limit extractLimit(Request request); static Offset extractOffset(Request request); static Optional<Double> extractPositiveDouble(Request request, String parameterName); static Optional<Integer> extractPositiveInteger(Request request, String parameterName); static final String LIMIT_PARAMETER_NAME; static final String OFFSET_PARAMETER_NAME; }