📍Use lombok, reformat, and optimize the code (#1560)
* Use lombok, reformat, and optimize the code * Fix merge conflicts and some sonar issues Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
@ -23,16 +23,14 @@
|
||||
|
||||
package com.iluwatar.nullobject;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Implementation for binary tree's normal nodes.
|
||||
*/
|
||||
@Slf4j
|
||||
public class NodeImpl implements Node {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(NodeImpl.class);
|
||||
|
||||
private final String name;
|
||||
private final Node left;
|
||||
private final Node right;
|
||||
|
@ -88,7 +88,7 @@ public class TreeTest {
|
||||
* Node#getTreeSize()} of 7 {@link Node}s in total.
|
||||
*/
|
||||
@Test
|
||||
public void testTreeSize() {
|
||||
void testTreeSize() {
|
||||
assertEquals(7, TREE_ROOT.getTreeSize());
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class TreeTest {
|
||||
* Walk through the tree and verify if every item is handled
|
||||
*/
|
||||
@Test
|
||||
public void testWalk() {
|
||||
void testWalk() {
|
||||
TREE_ROOT.walk();
|
||||
|
||||
assertTrue(appender.logContains("root"));
|
||||
@ -110,7 +110,7 @@ public class TreeTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetLeft() {
|
||||
void testGetLeft() {
|
||||
final var level1 = TREE_ROOT.getLeft();
|
||||
assertNotNull(level1);
|
||||
assertEquals("level1_a", level1.getName());
|
||||
@ -130,7 +130,7 @@ public class TreeTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRight() {
|
||||
void testGetRight() {
|
||||
final var level1 = TREE_ROOT.getRight();
|
||||
assertNotNull(level1);
|
||||
assertEquals("level1_b", level1.getName());
|
||||
|
Reference in New Issue
Block a user