I am looking to implement a functionality in a list of object as I would in C# using an extension method.
Something like this:
List<DataObject> list;
// ... List initialization.
list.getData(id);
How do I do that in Java?
Java does not support extension methods.
Instead, you can make a regular static method, or write your own class.