Lookups
is what is generally called a Service Locator and it's generally viewed as an anti-pattern these days but was quite common 5-8 years ago. The singleton()
method is a public static method on the class that is used to essentially find a reference to a basically global object. Imagine it looks like:
public class Lookups {
public static SomeObject singleton(InputObject obj) {
// use the parameter to return some other object
}
}
The reason it's viewed as an anti-pattern is that it can make it extremely difficult to unit test or mock sections of your code. In Java DI ("dependency injection") frameworks like Spring tend to be favoured over this approach.