code: public MockSecurityGroup authorizeSecurityGroupIngress(final String groupId, final String ipProtocol,
  final Integer fromPort, final Integer toPort, final String cidrIp) {
           if (groupId == null) {
               return null;
           }
           MockSecurityGroup ret = allMockSecurityGroup.get(groupId);
           if (ret != null) {
                MockIpPermissionType mockIpPermissionType = new MockIpPermissionType();
                mockIpPermissionType.setIpProtocol(ipProtocol);
                mockIpPermissionType.setFromPort(fromPort);
                mockIpPermissionType.setToPort(toPort);
                List<String> ipRanges = new ArrayList<String>();
                ipRanges.add(cidrIp);
                mockIpPermissionType.setIpRanges(ipRanges);
                List<MockIpPermissionType> mockIpPermissionTypes = ret.getIpPermissions();
                mockIpPermissionTypes.add(mockIpPermissionType);
                ret.setIpPermissions(mockIpPermissionTypes);
                allMockSecurityGroup.put(ret.getGroupId(), ret);
           }
           return ret;
       }
docs: Authorize the mock SecurityGroup to Ingress IpProtocol.
  @param groupId group Id.
  @param ipProtocol ipProtocol Ingress.
  @param fromPort fromPort for Security Group.
  @param toPort toPort for Security Group.
  @param cidrIp cidrIp for Ingress
  @return mock Security Group.