I would want to make sure that the declining languages had a good foothold in a lucrative industry.
COBOL programmers are increasingly valuable both because of their scarcity, and the fact that the small number of places that will need to continue maintenance on old legacy COBOL applications are mostly financial companies, who are using said COBOL applications for integral parts of their banking systems. It's a good market to cater to.
I don't necessarily have a crystal ball, but I'd bet that in 10-15 years Java will be a long way from a declining language; and I say that as someone who has never particularly liked it (the language itself, I think the JVM is actually a pretty badass virtual machine).