Component (Container aContainer, Component aComponent) { if (!myComponentToIndex.containsKey(aComponent)) { return null; } int i = myComponentToIndex.get(aComponent); return getPreviousComponent((i==-1 ?0:i) - 1); }