Skip to content
Advertisement

Category: Questions

implementation of LinkedList without last node

I have been asked to re-implement a linked list without the use of a tail. So I have to change its methods so it can work without using a tail node. The removeLast method confused me: here is what I tried to do, but it didn’t remove the node. What is wrong with my attempt? Test class Answer You need

How to Map Object response to another ObjectDto in java

I have to map rest template response to my DTO with different key and values. currently I am getting this json response from rest api And I want to map it into my DTO for me able to save into DB What i want is to get only same key dynamically to match with the response of api above. Currently

Applet not running

Im fairly new to java and applet but when I run my code I expect to be greeted with some sort of applet window however nothing happens when I run. What am I doing wrong, or am I missing something ? Answer As Java Client Roadmap Update During the past five years, most browser vendors have withdrawn support for plugins

Is OpenAPI v.3 incomplete or convertor is wrong?

I am trying to validate some data for the REST API using swagger description. I have converted swagger.json into OpenAPI 3.0.1 using swagger editor conversion option, and now trying to read it into OpenAPI object with ObjectMapper with following lines of code: First, I got an error as it could not recognized the field x-codegen-request-body-name generated by the converter. Fine,

Null pointer exception when using Mockito to mock interface

I’m using Mockito to test the following method: Here is my test: But I keep getting NullPointerExeption for this line: ValueProducerFactory is an Interface and the createValueProducer method signature is as follows: I have a class named CachingValueProducerFactory that implements the interface It seems like using Collections.emptyList() in the test is the problem, but I don’t see any other solution

Advertisement