private final AllocationComponentOperationPair createAndRegisterPair(final String namedIdentifier, final Operation operation, final AllocationComponent allocationComponent) { if (this.pairsByName.containsKey(namedIdentifier)) { throw new IllegalArgumentException("Element with name " + namedIdentifier + "exists already"); } final int id = this.getAndIncrementNextId(); final AllocationComponentOperationPair newInst = new AllocationComponentOperationPair(id, operation, allocationComponent); this.pairsById.put(id, newInst); this.pairsByName.put(namedIdentifier, newInst); return newInst; }