diff --git a/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Node.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Node.kt index 464daed444..77bb98f828 100644 --- a/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Node.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Node.kt @@ -5,9 +5,9 @@ package com.baeldung.binarytree * Note that this data type is neither immutable nor thread safe. */ class Node( - var key: Int, - var left: Node? = null, - var right: Node? = null) { + var key: Int, + var left: Node? = null, + var right: Node? = null) { /** * Return a node with given value. If no such node exists, return null. diff --git a/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/binarytree/NodeTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/binarytree/NodeTest.kt index 6c5ff18be7..9414d7dde9 100644 --- a/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/binarytree/NodeTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/binarytree/NodeTest.kt @@ -70,10 +70,8 @@ class NodeTest { @Test fun givenDepthTwo_whenPivotAtDepth2_then_Success() { - val left = - Node(1, Node(0), Node(2)) - val right = - Node(5, Node(4), Node(6)) + val left = Node(1, Node(0), Node(2)) + val right = Node(5, Node(4), Node(6)) val n = Node(3, left, right) assertEquals(left.left, n.find(0)) } @@ -246,8 +244,7 @@ class NodeTest { */ @Test fun givenTreeDepthOne_whenValueAbsent_thenNoChange() { - val n = - Node(1, Node(0), Node(2)) + val n = Node(1, Node(0), Node(2)) n.delete(3) assertEquals(1, n.key) assertEquals(2, n.right!!.key) @@ -285,11 +282,7 @@ class NodeTest { */ @Test fun givenTreeDepthTwo_whenNodeToDeleteHasOneChild_thenChangeTree() { - val n = Node( - 2, - Node(0, null, Node(1)), - Node(3) - ) + val n = Node(2, Node(0, null, Node(1)), Node(3)) n.delete(0) assertEquals(2, n.key) with(n.right!!) { @@ -306,13 +299,8 @@ class NodeTest { @Test fun givenTreeDepthThree_whenNodeToDeleteHasTwoChildren_thenChangeTree() { - val l = Node( - 2, - Node(1), - Node(5, Node(4), Node(6)) - ) - val r = - Node(10, Node(9), Node(11)) + val l = Node(2, Node(1), Node(5, Node(4), Node(6))) + val r = Node(10, Node(9), Node(11)) val n = Node(8, l, r) n.delete(8) assertEquals(6, n.key) diff --git a/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/ArrayTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/ArrayTest.kt index 406f19e89b..8e9467f92a 100644 --- a/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/ArrayTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/ArrayTest.kt @@ -7,7 +7,7 @@ class ArrayTest { @Test fun givenArray_whenValidateArrayType_thenComplete () { - val ex = com.baeldung.interoperability.ArrayExample() + val ex = ArrayExample() val numArray = intArrayOf(1, 2, 3) assertEquals(ex.sumValues(numArray), 6) @@ -15,7 +15,7 @@ class ArrayTest { @Test fun givenCustomer_whenGetSuperType_thenComplete() { - val instance = com.baeldung.interoperability.Customer::class + val instance = Customer::class val supertypes = instance.supertypes assertEquals(supertypes[0].toString(), "kotlin.Any") @@ -23,7 +23,7 @@ class ArrayTest { @Test fun givenCustomer_whenGetConstructor_thenComplete() { - val instance = com.baeldung.interoperability.Customer::class.java + val instance = Customer::class.java val constructors = instance.constructors assertEquals(constructors.size, 1) @@ -31,7 +31,7 @@ class ArrayTest { } fun makeReadFile() { - val ax = com.baeldung.interoperability.ArrayExample() + val ax = ArrayExample() ax.writeList() } } \ No newline at end of file diff --git a/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/CustomerTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/CustomerTest.kt index 7ed3bdfbec..c1b09cd0c1 100644 --- a/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/CustomerTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/CustomerTest.kt @@ -7,7 +7,7 @@ class CustomerTest { @Test fun givenCustomer_whenNameAndLastNameAreAssigned_thenComplete() { - val customer = com.baeldung.interoperability.Customer() + val customer = Customer() // Setter method is being called customer.firstName = "Frodo"