### Question:
Numbers { public static int parseIntSafe(@Nullable final String str) { if (str == null) { return 0; } try { final String s = str.trim(); if (s.isEmpty()) return 0; if (s.charAt(0) == '+') return Integer.parseInt(s.substring(1)); return Integer.parseInt(s); } catch (NumberFormatException e) { return 0; } }  static boolean valuesAreEqual(@Nullable final Number x, @Nullable final Number y); @SuppressWarnings("unchecked") @Contract(value = "_,!null -> !null; _,null -> null", pure = true) static N convertNumber(final Class<N> numberClass, final Number number); @Contract(value = "!null -> !null; null -> null", pure = true) static Number convertNumberSmartly(final BigDecimal decimal); static int parseIntSafe(@Nullable final String str); static long parseLongSafe(@Nullable final String str); static final Byte BYTE_ZERO; static final BigDecimal DECIMAL_ZERO; static final BigDecimal DECIMAL_MIN_LONG; static final BigDecimal DECIMAL_MAX_LONG; }### Answer:
@TestWithParams(params = "INT_CASES") public void parseIntSafe_with(String str, int result) { final int value = parseIntSafe(str); assertThat(value).isEqualTo(result); }