bundles/org.eclipse.packagedrone.storage.apm/src/org/eclipse/packagedrone/storage/apm/StorageManager.java
private static State getSameParent ( final State parent, final MetaKey key )
    {
        State current = parent;
        while ( current != null )
        {
            if ( current.key.equals ( key ) )
            {
                return current;
            }

            current = current.parent;
        }
        return null;
    }
private static State getSameParent ( final State parent, final MetaKey key )
    {
        State current = parent;
        while ( current != null )
        {
            if ( current.key.equals ( key ) )
            {
                return current;
            }

            current = current.parent;
        }
        return null;
    }
private static State getSameParent ( final State parent , final MetaKey key ) { State current = parent ; while ( current != null ) { if ( current . key . equals ( key ) ) { return current ; } current = current . parent ; } return null ; }
Traverse up from the provided parent and find the first which uses the
same key

@param parent
the first parent candidate
@param key
the key to look for
@return the first parent (which may be the input parameter), which uses
the same key
Traverse up from the provided parent and find the first which uses the same key