(No network knowledge is required. This is purely String and Lists).
Let's say I have a function in place that takes a String IPv4 dotted address list and sorts them in ascending order. (Not in alphabetical order, true sorting by long ip format). Let me call it:
public static ArrayList<String> sortListOfIpv4s(ArrayList<String> unsortedIPv4s);
This feature is already working correctly. Given input:
192.168.1.1, 8.8.8.8, 4.5.6.7, 244.244.244.244, 146.144.111.6
It will list:
4.5.6.7, 8.8.8.8, 146.144.111.6, 192.168.1.1, 244.244.244.244
(Let's not discuss whether to change the list in place or return a new list. It just returns a new list. Also, this function cannot be changed for many reasons. )
However, my input list is as follows:
e192.168.1.1, f8.8.8.8, e4.5.6.7, f244.244.244.244, e146.144.111.6
( e f, NOT NECESSARILY alternating) , . :
e4.5.6.7, f8.8.8.8, e146.144.111.6, e192.168.1.1, f244.244.244.244
, , .
:
, ? (, , IPv4 String arraylists).