Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
