public static bool FitsInto(this IHas <IPackageLogic> package, IHas <IContainerLogic> container) { for (int i = 0; i < 6; i++) { if (package.CanRotate(i)) { package.Rotate(i); if (container.Contains(package)) { return(true); } package.InvertRotate(i); } } return(false); }