### Question:
XSSFunctions { public static Integer getValidInteger(XSSAPI xssAPI, String integer, int defaultValue) { return xssAPI.getValidInteger(integer, defaultValue); } private  XSSFunctions(); static CharSequence encodeForHTML(XSSAPI xssAPI, String source); @Deprecated static CharSequence encodeForHTML(com.adobe.granite.xss.XSSAPI xssAPI, String source); static CharSequence encodeForHTMLAttr(XSSAPI xssAPI, String source); @Deprecated static CharSequence encodeForHTMLAttr(com.adobe.granite.xss.XSSAPI xssAPI, String source); static CharSequence encodeForJSString(XSSAPI xssAPI, String source); @Deprecated static CharSequence encodeForJSString(com.adobe.granite.xss.XSSAPI xssAPI, String source); static CharSequence filterHTML(XSSAPI xssAPI, String source); @Deprecated static CharSequence filterHTML(com.adobe.granite.xss.XSSAPI xssAPI, String source); static CharSequence getValidHref(XSSAPI xssAPI, String source); @Deprecated static CharSequence getValidHref(com.adobe.granite.xss.XSSAPI xssAPI, String source); static String getValidDimension(XSSAPI xssAPI, String dimension, String defaultValue); @Deprecated static String getValidDimension(com.adobe.granite.xss.XSSAPI xssAPI, String dimension, String defaultValue); static Integer getValidInteger(XSSAPI xssAPI, String integer, int defaultValue); @Deprecated static Integer getValidInteger(com.adobe.granite.xss.XSSAPI xssAPI, String integer, int defaultValue); static String getValidJSToken(XSSAPI xssAPI, String token, String defaultValue); @Deprecated static String getValidJSToken(com.adobe.granite.xss.XSSAPI xssAPI, String token, String defaultValue);  }### Answer:
@Test public void testGetValidInteger() { final String integer = RandomStringUtils.randomAlphanumeric(10); final int defaultValue = new Random().nextInt(); XSSFunctions.getValidInteger(xssAPI, integer, defaultValue); verify(xssAPI, only()).getValidInteger(integer, defaultValue); }
@Test public void testGetValidInteger_granite() { final String integer = RandomStringUtils.randomAlphanumeric(10); final int defaultValue = new Random().nextInt(); XSSFunctions.getValidInteger(graniteXssAPI, integer, defaultValue); verify(graniteXssAPI, only()).getValidInteger(integer, defaultValue); }