Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve the code in java Sovle the error in nameLookup class ( picture of error provided ) public class NameLookup implements Lookup { private String
Solve the code in java
Sovle the error in nameLookup class picture of error provided
public class NameLookup implements Lookup
private String prefix;
public NameLookupString name
this.prefix name;
public boolean matchesProduct product
if prefix null && product.getName null
return true; Both prefix and product name are null, consider them equal
if prefix null && prefix.equalsproductgetName
return true; Prefix is not null, and product name matches prefix
return false; Otherwise, consider them not equal
Failed: Hint: two names with null values are considered equal expected: org.opentestAssertionFailedError: Hint: two names with null values are considere:
org.junit.jupiter.api.AssertionUtils.failjava:
org.junit.jupiter.api.AssertTrue.assertTruejava:
org.junit.jupiter.api.Assertions.assertTruejava:
InstructorTest$NameLookupTest.testNoMatch
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started