I have a model abstract class which declares a List of items. The abstract has two abstract class. One in which you can add new items to the list and one that doesn't use the list at all but adheres otherwise to the other behavior of the model abstract class.
I declared two methods to add and remove items from the list. Obviously, whenever I want to use those methods I need to cast my model abstract with its subclass.
Can I violate LSP (Liskov substitution principle) in this case? Or is there a way around this problem?
I think you will violate LSP.
From the Wikipedia page for LSP (that is always your friend ;):
"More formally, the Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called (strong) behavioral subtyping"
"Behavioral subtyping is a stronger notion than typical subtyping of functions defined in type theory, which relies only on the contravariance of argument types and covariance of the return type. Behavioral subtyping is trivially undecidable in general"
Looks similar to your case:
"A typical example that violates LSP is a Square class that derives from a Rectangle class, assuming getter and setter methods exist for both width and height. The Square class always assumes that the width is equal with the height. If a Square object is used in a context where a Rectangle is expected, unexpected behavior may occur because the dimensions of a Square cannot (or rather should not) be modified independently. This problem cannot be easily fixed: if we can modify the setter methods in the Square class so that they preserve the Square invariant (i.e., keep the dimensions equal), then these methods will weaken (violate) the postconditions for the Rectangle setters, which state that dimensions can be modified independently. Violations of LSP, like this one, may or may not be a problem in practice"