class LayerLinker {

    public String getLinkedLayerId(String layerId)
    {
        LinkedLayers linkedLayers = myPrefs.getJAXBObject(LinkedLayers.class, ourLinkedLayersKey, (LinkedLayers)null);
        String linkedLayerId = null;

        if (linkedLayers != null)
        {
            for (LinkedLayer linkedLayer : linkedLayers.getLinkedLayers())
            {
                if (layerId.equals(linkedLayer.getLinkedLayersTypeKey()))
                {
                    linkedLayerId = linkedLayer.getOtherLinkedLayersTypeKey();
                    break;
                }
                else if (layerId.equals(linkedLayer.getOtherLinkedLayersTypeKey()))
                {
                    linkedLayerId = linkedLayer.getLinkedLayersTypeKey();
                    break;
                }
            }
        }

        return linkedLayerId;
    }

    public  LayerLinker(PreferencesRegistry prefsRegistry);

}