### Question:
ValueObjectUtils { public static List<? extends SchemaElement> sortResourceGroupElement(List<? extends SchemaElement> list) { if(list == null || list.isEmpty()) { return list; } Comparator<SchemaElement> comparator = new Comparator<SchemaElement>() { public int compare(SchemaElement elem1, SchemaElement elem2) { if (elem1 != null && elem2 != null) return ObjectUtils.compare(elem1.getName(), elem2.getName()); else if (elem1 == null) return 1; else if(elem2 == null) return -1; else return 0; } }; Collections.sort(list, comparator); if (list.get(0) instanceof AbstractResourceGroupElement || list.get(0) instanceof ConstantsResourceGroupElement) { for (SchemaElement element : list) { if (element instanceof AbstractResourceGroupElement) { sortResourceGroupElement(((AbstractResourceGroupElement) element).getElements()); } else if (element instanceof ConstantsResourceGroupElement) { sortResourceGroupElement(((ConstantsResourceGroupElement) element).getElements()); } } } return list; }  static T copyOf(T element); static boolean equalGroupElements(List<? extends SchemaElement> groupElements1, List<? extends SchemaElement> groupElements2); static List<? extends SchemaElement> sortResourceGroupElement(List<? extends SchemaElement> list); static boolean isListsOfArraysEquals(List<T[]> first, List<T[]> second); static boolean isMapsWithArraysAsValuesEquals(Map<KEY, VALUE[]> first, Map<KEY, VALUE[]> second); static int hashCodeOfMapWithArraysAsValues(Map<KEY, VALUE[]> map); static int hashCodeOfListOfArrays(List<T[]> list); static void checkNotNull(Object object); static void checkNotNull(Object object, String message);  }### Answer:
@Test public void sortResourceGroupElement_test() { List<SchemaElement> l1 = getSchemaElementList("test1","test2",false); List<SchemaElement> l2 = getSchemaElementList("test2","test1", false); assertEquals(l1.hashCode(),ValueObjectUtils.sortResourceGroupElement(l2).hashCode()); }