public static ICollection <SafeType <APIOperation> > Spi2Apis(SafeType <SPIOperation> type) { type = type.GetTypeErasure(); HashSet <SafeType <APIOperation> > set = new HashSet <SafeType <APIOperation> >(); set.Add(SPI_TO_API[type]); // add GetApiOp if search is available.. if (type.RawType.Equals(typeof(SearchOp <>))) { set.Add(SafeType <APIOperation> .Get <GetApiOp>()); } return(set); }