### Question:
CajaCssUtils { public static String restoreIp6Uris(String styleSheet, List<String> ip6Uris) { if (ip6Uris == null || ip6Uris.size() == 0) { return styleSheet; } int length = styleSheet.length(); int i = 0; int startToken = -1; int finishToken = -1; boolean finish = false; StringBuilder output = new StringBuilder(); while (!finish) { boolean found = false; Character ch = styleSheet.charAt(i); if (ch.equals('i') && ((i+1) < length) && styleSheet.charAt(i+1) == 'p' && ((i+2) < length) && styleSheet.charAt(i+2) == 'v' && ((i+3) < length) && styleSheet.charAt(i+3) == '6' && ((i+4) < length) && styleSheet.charAt(i+4) == 'i') { boolean numbers = true; startToken = i; finishToken = i + 5; while (numbers) { if (finishToken < length && styleSheet.charAt(finishToken) >= '0' && styleSheet.charAt(finishToken) <= '9') { finishToken++; } else { numbers = false; } } if (finishToken < length && styleSheet.charAt(finishToken) == 'f') { String token = styleSheet.substring(startToken, finishToken); int index = -1; try { index = new Integer(token.substring(5, token.length())); } catch (Exception e) { } if (index > -1 && index < ip6Uris.size() ) { output.append(ip6Uris.get(index)); found = true; i = finishToken; } } } if (!found) { output.append(ch); } i++; if (i >= length) { finish = true; } } return output.toString(); } private  CajaCssUtils(); static List<T> children(CssTree node, Class<T> nodeType); static List<T> descendants(CssTree node, final Class<T> nodeType); static void saveIp6Uris(CssTree.StyleSheet styleSheet, List<String> ip6Uris); static String restoreIp6Uris(String styleSheet, List<String> ip6Uris); static String extractIp6(String sUri);  }### Answer:
@Test public void restoreIp6UrisTest() throws Exception { String styleSheet = "ipv6i0f ipv6i2f bla bla bla bla bla bla ipv6i1f bla bla bla"; List<String> ip6Uris = new ArrayList<String>(); ip6Uris.add("change0"); ip6Uris.add("change1"); ip6Uris.add("change2"); String expected = "change0 change2 bla bla bla bla bla bla change1 bla bla bla"; assertEquals(expected, CajaCssUtils.restoreIp6Uris(styleSheet, ip6Uris)); styleSheet = "ipv6i0f ipv6i2f bla bla bla bla bla bla ipv6i1af bla bla bla"; expected = "change0 change2 bla bla bla bla bla bla ipv6i1af bla bla bla"; assertEquals(expected, CajaCssUtils.restoreIp6Uris(styleSheet, ip6Uris)); styleSheet = "ipv6i0f ipv6i2f bla bla bla bla bla bla ipv6i122222"; expected = "change0 change2 bla bla bla bla bla bla ipv6i122222"; assertEquals(expected, CajaCssUtils.restoreIp6Uris(styleSheet, ip6Uris)); }