### Question:
MethodSorter { public static Method[] getDeclaredMethods(Class<?> clazz) { Comparator<Method> comparator = getSorter(clazz.getAnnotation(FixMethodOrder.class)); Method[] methods = clazz.getDeclaredMethods(); if (comparator != null) { Arrays.sort(methods, comparator); } return methods; } private  MethodSorter(); static Method[] getDeclaredMethods(Class<?> clazz); static final Comparator<Method> DEFAULT; static final Comparator<Method> NAME_ASCENDING; }### Answer:
@Test public void testJvmMethodSorter() { Method[] fromJvmWithSynthetics = DummySortJvm.class.getDeclaredMethods(); Method[] sorted = MethodSorter.getDeclaredMethods(DummySortJvm.class); assertArrayEquals(fromJvmWithSynthetics, sorted); }