Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class ArrayUtils {

private ArrayUtils() {
}

private static Random rand = new Random();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class Combinatorics {

private Combinatorics() {
}

/**
* Pascal's Triangle
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class Geometry {

private Geometry() {
}

private static final double SIMPLE_PI = 3.14;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

public class Measurement {

private Measurement() {
}

/**
* Converts miles to kilometers
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*/
public class NumberTheory {

private NumberTheory() {
}

/**
* Least common multiple (lcm) of two numbers.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

public class Numbers {

private Numbers() {
}

/**
* Checks if a number contains a digit
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class Statistics {

private Statistics() {
}

/**
* An average is the sum of a list of numbers divided by the number of
* numbers in the list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*/
public class BinarySearch {

private BinarySearch() {
}

/**
* Finds an element in an ordered list
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class StringUtils {

private StringUtils() {
}

public static boolean isPalindrome(String theString) {
if (theString == null || theString.isEmpty()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

class ArrayUtilsTest {

@Test
void shouldCreateInstance() {
assertThat(new ArrayUtils()).isNotNull();
}

@Test
void shouldNotShuffleSmallArray() {
int[] array = new int[]{1};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@

class CombinatoricsTest {

@Test
void shouldCreateInstance() {
assertThat(new Combinatorics()).isNotNull();
}

@Test
void shouldCalculateBinomialCoefficient() {
// invalid inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

class GeometryTest {

@Test
void shouldCreateInstance() {
assertThat(new Geometry()).isNotNull();
}

@Test
void shouldCalculateDistance() {
assertThat(Geometry.distance(-2, 1, 1, 5)).isCloseTo(5.0, within(0.1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

class MeasurementTest {

@Test
void shouldCreateInstance() {
assertThat(new Measurement()).isNotNull();
}

@Test
void shouldConvertMilesToKilometers() {
assertThat(Measurement.milesToKilometers(1)).isCloseTo(1.609344, within(0.1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

class NumberTheoryTest {

@Test
void shouldCreateInstance() {
assertThat(new NumberTheory()).isNotNull();
}

@Test
void shouldFindLeastCommonMultiplesOfTwoNumbers() {
assertThat(NumberTheory.lcm(1, 2)).isEqualTo(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

class NumbersTest {

@Test
void shouldCreateInstance() {
assertThat(new Numbers()).isNotNull();
}

@Test
void shouldHandleContainsDigit() {
assertThat(Numbers.containsDigit(124, 4)).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

class StatisticsTest {

@Test
void shouldCreateInstance() {
assertThat(new Statistics()).isNotNull();
}

@Test
void shouldCalculateMean() {
assertThat(Statistics.mean(new double[]{})).isCloseTo(0.0, within(0.1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

class StringUtilsTest {

@Test
void shouldCreateInstance() {
assertThat(new StringUtils()).isNotNull();
}

@Test
void shouldConsiderPalindrome() {
assertThat(StringUtils.isPalindrome("a")).isTrue();
Expand Down
Loading