You are required to develop a Java API that can rapidly compare a query text file against a n-
gram collection of subject texts and determine the natural language of the query file. The API
should uphold the principles of loose-coupling and high cohesion throughout its design by
correctly applying abstraction, encapsulation, composition and inheritance.