📍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:
va1m
2021-03-13 13:19:21 +01:00
committed by GitHub
parent 0e26a6adb5
commit 5cf2fe009b
681 changed files with 2472 additions and 4966 deletions

View File

@ -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;

View File

@ -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());