Web services way...

API consuming is the best, quickest and the most reliable way to get real names. The API is located here:

https://gentle-journey-86001.herokuapp.com/real-names/generate
Usually the process of working via an API has two stages: So, if you need not only to send request to API, but also receive a response, you need a tool that can perform both stages, or you have to select several tools that work smoothly with each other to perform all required actions.

Nowadays there are lots of different tools (libraries, frameworks, DSLs) to get data via API. Here is the short list of the most popular tools:

Please note, that if you want to know about how to use some other library/framework to consume API, please use a feedback form on the about page to let me know.

Jersey + Jackson bundle

Jersey and Jackson is a perfect bundle, where Jersey is used as a transport tool and Jackson is a wat to serialize/deserialize request/response to the convenient form for further processing. Of course, it is used not for client creation only.

To use Jersey with Jackson first you need to create class where the data, received in response will be applied to (mapped). Every field should be mentioned in the model and each field should have its getter and setter (setters aren't required here, as we'll set nothing, but they should be present). Method, that prints the object (toString()) should be overridden

RealNamesModel.java

    public class RealNamesModel {

    private String firstName;
    private String lastName;
    private String fullName;
    private String timeTaken;

    public RealNamesModel(){}

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getTimeTaken() {
        return timeTaken;
    }

    public void setTimeTaken(String timeTaken) {
        this.timeTaken = timeTaken;
    }

    @Override
    public String toString() {
        return "RealNamesModel{" +
                "firstName='" + firstName + '\'' +
                ", lastName='" + lastName + '\'' +
                ", fullName='" + fullName + '\'' +
                '}';
    }
         
RealNamesTest.java

public class RealNamesTest{

    private final String URI = "https://gentle-journey-86001.herokuapp.com/real-names/generate";
    private RealNamesModel realNamesModel = new RealNamesModel();

    @Test
    public void getRealNames(){
        //Client initialization
        Client client = ClientBuilder.newClient();
        //Target initialization and pointing client
        WebTarget target = client.target(URI);
        //preparing response
        Response response = target.request(MediaType.APPLICATION_JSON_TYPE)
                .accept(MediaType.APPLICATION_JSON_TYPE).get();
        //Mapping the response object to given class
        realNamesModel = response.readEntity(RealNamesModel.class);
        //Printing the whole object
        System.out.println(realNamesModel.toString());
        //Getting each value separately
        System.out.println(realNamesModel.getFirstName());
        System.out.println(realNamesModel.getLastName());
        System.out.println(realNamesModel.getFullName());
    }
 }

The fully working example is available on Github: real-names-jersey-jackson-example

Jersey + GSON bundle

Apache HTTP Client