mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/osgi/EventAdminMessageService.java
private boolean topicListsEqual(final ProtocolStringList list1, final ProtocolStringList list2)
    {
        if (list1.size() != list2.size())
        {
            return false;
        }
        
        final List<String> sortedList1 = new ArrayList<>(list1);
        sortedList1.sort(String::compareTo);

        final List<String> sortedList2 = new ArrayList<>(list2);
        sortedList2.sort(String::compareTo);
        
        for (int i = 0; i < sortedList1.size(); ++i)
        {
            if (!sortedList1.get(i).equals(sortedList2.get(i)))
            {
                return false;
            }
        }

        return true;
    }
/**
     * Helper function used to compare topic lists and determine whether they are equal.
     * @param list1
     *      first list to compare
     * @param list2
     *      second list to compare
     * @return
     *      true if the lists are equal, false otherwise
     */
Helper function used to compare topic lists and determine whether they are equal.
@param list1
first list to compare
@param list2
second list to compare
@return
true if the lists are equal, false otherwise
Helper function used to compare topic lists and determine whether they are equal . @param list1 first list to compare @param list2 second list to compare @return true if the lists are equal false otherwise
private boolean topicListsEqual(final ProtocolStringList list1, final ProtocolStringList list2)
    {
        if (list1.size() != list2.size())
        {
            return false;
        }
        final List<String> sortedList1 = new ArrayList<>(list1);
        sortedList1.sort(String::compareTo);
        final List<String> sortedList2 = new ArrayList<>(list2);
        sortedList2.sort(String::compareTo);
        for (int i = 0; i < sortedList1.size(); ++i)
        {
            if (!sortedList1.get(i).equals(sortedList2.get(i)))
            {
                return false;
            }
        }
        return true;
    }
private boolean topicListsEqual ( final ProtocolStringList list1 , final ProtocolStringList list2 ) { if ( list1 . size ( ) != list2 . size ( ) ) { return false ; } final List < String > sortedList1 = new ArrayList < > ( list1 ) ; sortedList1 . sort ( String :: compareTo ) ; final List < String > sortedList2 = new ArrayList < > ( list2 ) ; sortedList2 . sort ( String :: compareTo ) ; for ( int i = 0 ; i < sortedList1 . size ( ) ; ++ i ) { if ( ! sortedList1 . get ( i ) . equals ( sortedList2 . get ( i ) ) ) { return false ; } } return true ; }
Helper function used to compare topic lists and determine whether they are equal.
Helper function used to compare topic lists and determine whether they are equal .