### Question:
VersionComparator implements Comparator<String> { @Override public int compare(String left, String right) { int[] leftComponents = Arrays.stream(left.split("\\.")).mapToInt(Integer::parseInt).toArray(); int[] rightComponents = Arrays.stream(right.split("\\.")).mapToInt(Integer::parseInt).toArray(); for(int i = 0; i < 3; i++) { int l = leftComponents[i]; int r = rightComponents[i]; if(l != r) { return Integer.signum(l - r); } } return 0; } private  VersionComparator(); @Override int compare(String left, String right); static final VersionComparator INSTANCE; }### Answer:
@Test public void test() { int actual = VersionComparator.INSTANCE.compare(left, right); assertEquals(expectedResult, actual); }