NumberParserUtils { public static int getAsInt(@Nullable Map<String, ?> imgDetails, @Nullable String key, int defaultValue) { if (imgDetails == null || key == null) { return defaultValue; } return NumberParserUtils.getAsInt(imgDetails.get(key),defaultValue); } private  NumberParserUtils(); static float getAsFloat(@Nullable Object in, float defaultValue); static float getAsFloat(@Nullable Map<String, ?> imgDetails, @Nullable String key, float defaultValue); static int getAsInt(@Nullable Map<String, ?> imgDetails, @Nullable String key, int defaultValue); static int getAsInt(@Nullable Object in, int defaultValue);  }
@Test public void getAsInt_inIsStringChar() { assertThat(NumberParserUtils.getAsInt("a", DEFAULT_INT)).isEqualTo(DEFAULT_INT); }
@Test public void getAsInt_inIsStringBlank() { assertThat(NumberParserUtils.getAsInt(" ", DEFAULT_INT)).isEqualTo(DEFAULT_INT); }
@Test public void getAsInt_inIsNull() { assertThat(NumberParserUtils.getAsInt(null, DEFAULT_INT)).isEqualTo(DEFAULT_INT); }
@Test public void getAsInt_inIsFloat() { assertThat(NumberParserUtils.getAsInt(3.0, DEFAULT_INT)).isEqualTo(3); }
@Test public void getAsInt_inIsStringNumber() { assertThat(NumberParserUtils.getAsInt("3", DEFAULT_INT)).isEqualTo(3); }