Although LineImpl is a subtype of Line, List<LineImpl> is *not* a subtype of List<Line>. The reason is that cannot add a Line to List<LineImpl>, so not everything you can do with a List<Line> you can also do with a List<LineImpl>.
A solution is to use a List<? extends Line> as the return type. That way you can also return a List<LineImpl>, but you cannot call methods that get a Line as parameter on that List (which in consequence basically makes it a read-only List).
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Returning generic lists that implement a common interface