For example, "unconscionable contracts" are unenforceable [1], custody disputes are resolved based on the "best interests of the child" test [2], and a cop's reasonable suspicion is judged by the "totality of the circumstances" [3].
All of these and many more require (some more explicitly than others) the judge to determine what is "fair" so that he or she can fairly apply law and precedent to a specific set of facts. This is much more common than you might think (and than many in the legal community would like to admit).
If you find this topic interesting, I would encourage you to read about the differences between deductive reasoning (like math) and inductive reasoning (like fairness). Some court decisions truly are deductive, but most are not.
[1] https://en.wikipedia.org/wiki/Unconscionability
[2] http://pediatrics.aappublications.org/content/134/Supplement...
[3] https://en.wikipedia.org/wiki/Totality_of_the_circumstances