Top Fields Constructors Methods
org.assertj.core.api

public Class AtomicLongArrayAssert

extends AbstractEnumerableAssert<AtomicLongArrayAssert, AtomicLongArray, Long>
Class Inheritance
Static Imports
org.assertj.core.util.Arrays.array

Field Summary

Modifier and TypeField and Description
private long[]
protected LongArrays

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public AtomicLongArrayAssert

Returns:

this assertion object.
contains
(long...
the given values.
values
)

Verifies that the actual AtomicLongArray contains the given values, in any order.

public AtomicLongArrayAssert

Returns:

myself assertion object.
contains
(long
the value to look for.
value
,
Index
the index where the value should be stored in the actual atomic array.
index
)

Verifies that the actual atomic array contains the given value at the given index.

public AtomicLongArrayAssert

Returns:

this assertion object.
containsAnyOf
(long...
the values whose at least one which is expected to be in the array under test.
values
)

Verifies that the actual array contains at least one of the given values.

public AtomicLongArrayAssert

Returns:

this assertion object.
containsExactly
(long...
the given values.
values
)

Verifies that the actual AtomicLongArray contains only the given values and nothing else, in order.

public AtomicLongArrayAssert

Returns:

this assertion object.
containsExactlyInAnyOrder
(long...
the given values.
values
)

Verifies that the actual AtomicLongArray contains exactly the given values and nothing else, in any order.

public AtomicLongArrayAssert

Returns:

this assertion object.
containsOnly
(long...
the given values.
values
)

Verifies that the actual atomic array contains only the given values and nothing else, in any order.

public AtomicLongArrayAssert

Returns:

this assertion object.
containsOnlyOnce
(long...
the given values.
values
)

Verifies that the actual atomic array contains the given values only once.

public AtomicLongArrayAssert

Returns:

myself assertion object.
containsSequence
(long...
the sequence of values to look for.
sequence
)

Verifies that the actual atomic array contains the given sequence, without any other values between them.

public AtomicLongArrayAssert

Returns:

myself assertion object.
containsSubsequence
(long...
the subsequence of values to look for.
subsequence
)

Verifies that the actual atomic array contains the given subsequence (possibly with other values between them).

public AtomicLongArrayAssert

Returns:

this assertion object.
doesNotContain
(long...
the given values.
values
)

Verifies that the actual atomic array does not contain the given values.

public AtomicLongArrayAssert

Returns:

myself assertion object.
doesNotContain
(long
the value to look for.
value
,
Index
the index where the value should be stored in the actual atomic array.
index
)

Verifies that the actual atomic array does not contain the given value at the given index.

public AtomicLongArrayAssert

Returns:

this assertion object.
doesNotHaveDuplicates
()

Verifies that the actual atomic array does not contain duplicates.

public AtomicLongArrayAssert

Returns:

myself assertion object.
endsWith
(long...
the sequence of values to look for.
sequence
)

Verifies that the actual atomic array ends with the given sequence of values, without any other values between them.

public AtomicLongArrayAssert

Returns:

this assertion object.
hasArray
(long[]
the long[] array expected to be in the actual AtomicLongArray.
expected
)

Verifies that the AtomicLongArray has the given array.

public AtomicLongArrayAssert

Returns:

this assertion object.
hasSameSizeAs
(Iterable<?>
the Iterable to compare size with actual AtomicLongArray.
other
)

Implements org.assertj.core.api.EnumerableAssert.hasSameSizeAs.

Verifies that the AtomicLongArray has the same size as given Iterable.
public AtomicLongArrayAssert

Returns:

this assertion object.
hasSize
(int
the expected number of values in the actual AtomicLongArray.
expected
)

Implements org.assertj.core.api.EnumerableAssert.hasSize.

Verifies that the number of values in the AtomicLongArray is equal to the given one.
public AtomicLongArrayAssert

Returns:

this assertion object.
hasSizeBetween
(int
the lower boundary compared to which actual size should be greater than or equal to.
lowerBoundary
,
int
the higher boundary compared to which actual size should be less than or equal to.
higherBoundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeBetween.

Verifies that the number of values in the actual array is between the given boundaries (inclusive).
public AtomicLongArrayAssert

Returns:

this assertion object.
hasSizeGreaterThan
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThan.

Verifies that the number of values in the actual array is greater than the given boundary.
public AtomicLongArrayAssert

Returns:

this assertion object.
hasSizeGreaterThanOrEqualTo
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThanOrEqualTo.

Verifies that the number of values in the actual array is greater than or equal to the given boundary.
public AtomicLongArrayAssert

Returns:

this assertion object.
hasSizeLessThan
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThan.

Verifies that the number of values in the actual array is less than the given boundary.
public AtomicLongArrayAssert

Returns:

this assertion object.
hasSizeLessThanOrEqualTo
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThanOrEqualTo.

Verifies that the number of values in the actual array is less than or equal to the given boundary.
public void
isEmpty()

Implements org.assertj.core.api.EnumerableAssert.isEmpty.

Verifies that the AtomicLongArray is empty.
public AtomicLongArrayAssert

Returns:

this assertion object.
isNotEmpty
()

Implements org.assertj.core.api.EnumerableAssert.isNotEmpty.

Verifies that the AtomicLongArray is not empty.
public void
isNullOrEmpty()

Implements org.assertj.core.api.EnumerableAssert.isNullOrEmpty.

Verifies that the AtomicLongArray is null or empty.
public AtomicLongArrayAssert

Returns:

this assertion object.
isSorted
()

Verifies that the actual AtomicLongArray is sorted in ascending order according to the natural ordering of its elements.

public AtomicLongArrayAssert

Returns:

this assertion object.
isSortedAccordingTo
(Comparator<? super Long>
the Comparator used to compare array elements
comparator
)

Verifies that the actual AtomicLongArray is sorted according to the given comparator.

public AtomicLongArrayAssert

Returns:

myself assertion object.
startsWith
(long...
the sequence of values to look for.
sequence
)

Verifies that the actual atomic array starts with the given sequence of values, without any other values between them.

public AtomicLongArrayAssert
usingDefaultElementComparator()

Implements org.assertj.core.api.EnumerableAssert.usingDefaultElementComparator.

Revert to standard comparison for incoming assertion group element checks.
public AtomicLongArrayAssert

Returns:

this assertion object.
usingElementComparator
(Comparator<? super Long>
the comparator to use for incoming assertion checks.
customComparator
)

Implements org.assertj.core.api.EnumerableAssert.usingElementComparator.

Use given custom comparator instead of relying on Long equals method to compare elements for incoming assertion checks.
Inherited from org.assertj.core.api.AbstractEnumerableAssert:
hasSameSizeAsinBinaryinHexadecimal

Field Detail

arrayback to summary
private long[] array
arraysback to summary
protected LongArrays arrays
Annotations
@VisibleForTesting

Constructor Detail

AtomicLongArrayAssertback to summary
public AtomicLongArrayAssert(AtomicLongArray actual)

Method Detail

containsback to summary
public AtomicLongArrayAssert contains(long... values)

Verifies that the actual AtomicLongArray contains the given values, in any order.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertions will pass
assertThat(atomicLongArray).contains(1, 2)
                           .contains(3, 1)
                           .contains(1, 3, 2);

// assertions will fail
assertThat(atomicLongArray).contains(2, 3, 4);
assertThat(atomicLongArray).contains(4, 5, 6);
Parameters
values:long[]

the given values.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
NullPointerException:
if the given argument is null.
IllegalArgumentException:
if the given argument is an empty array.
AssertionError:
  • if the actual atomic array is null.
  • if the actual atomic array does not contain the given values.
Since
2.7.0 / 3.7.0
containsback to summary
public AtomicLongArrayAssert contains(long value, Index index)

Verifies that the actual atomic array contains the given value at the given index.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertions will pass
assertThat(atomicLongArray).contains(1, atIndex(O))
                           .contains(3, atIndex(2));

// assertions will fail
assertThat(atomicLongArray).contains(1, atIndex(1));
assertThat(atomicLongArray).contains(4, atIndex(2));
Parameters
value:long

the value to look for.

index:Index

the index where the value should be stored in the actual atomic array.

Returns:AtomicLongArrayAssert

myself assertion object.

Exceptions
AssertionError:
  • if the actual atomic array is null or empty.
  • if the actual atomic array does not contain the given value at the given index.
NullPointerException:
if the given Index is null.
IndexOutOfBoundsException:
if the value of the given Index is equal to or greater than the size of the actual atomic array.
Since
2.7.0 / 3.7.0
containsAnyOfback to summary
public AtomicLongArrayAssert containsAnyOf(long... values)

Verifies that the actual array contains at least one of the given values.

Example :

 AtomicLongArray oneTwoThree = new AtomicLongArray(new long[] { 1L, 2L, 3L });

// assertions will pass
assertThat(oneTwoThree).containsAnyOf(2L)
                       .containsAnyOf(2L, 3L)
                       .containsAnyOf(1L, 2L, 3L)
                       .containsAnyOf(1L, 2L, 3L, 4L)
                       .containsAnyOf(5L, 6L, 7L, 2L);

// assertions will fail
assertThat(oneTwoThree).containsAnyOf(4L);
assertThat(oneTwoThree).containsAnyOf(4L, 5L, 6L, 7L);
Parameters
values:long[]

the values whose at least one which is expected to be in the array under test.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
NullPointerException:
if the array of values is null.
IllegalArgumentException:
if the array of values is empty and the array under test is not empty.
AssertionError:
  • if the array under test is null.
  • if the array under test does not contain any of the given values.
Since
2.9.0 / 3.9.0
containsExactlyback to summary
public AtomicLongArrayAssert containsExactly(long... values)

Verifies that the actual AtomicLongArray contains only the given values and nothing else, in order.

Example :

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).containsExactly(1, 2, 3);

// assertion will fail as actual and expected order differ
assertThat(atomicLongArray).containsExactly(2, 1, 3);
Parameters
values:long[]

the given values.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
NullPointerException:
if the given argument is null.
AssertionError:
  • if the actual AtomicLongArray is null.
  • if the actual AtomicLongArray does not contain the given values with same order, i.e. it contains some or none of the given values, or more values than the given ones or values are the same but the order is not.
Since
2.7.0 / 3.7.0
containsExactlyInAnyOrderback to summary
public AtomicLongArrayAssert containsExactlyInAnyOrder(long... values)

Verifies that the actual AtomicLongArray contains exactly the given values and nothing else, in any order.

Example :

 // assertions will pass
assertThat(new AtomicLongArray(new long[] { 1, 2 })).containsExactlyInAnyOrder(1, 2);
assertThat(new AtomicLongArray(new long[] { 1, 2, 1 })).containsExactlyInAnyOrder(1, 1, 2);

// assertions will fail
assertThat(new AtomicLongArray(new long[] { 1, 2 })).containsExactlyInAnyOrder(1);
assertThat(new AtomicLongArray(new long[] { 1 })).containsExactlyInAnyOrder(1, 2);
assertThat(new AtomicLongArray(new long[] { 1, 2, 1 })).containsExactlyInAnyOrder(1, 2);
Parameters
values:long[]

the given values.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
NullPointerException:
if the given argument is null.
AssertionError:
  • if the actual AtomicLongArray is null.
  • if the actual AtomicLongArray does not contain the given values, i.e. it contains some or none of the given values, or more values than the given ones.
Since
2.7.0 / 3.7.0
containsOnlyback to summary
public AtomicLongArrayAssert containsOnly(long... values)

Verifies that the actual atomic array contains only the given values and nothing else, in any order.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertions will pass
assertThat(atomicLongArray).containsOnly(1, 2, 3)
                           .containsOnly(2, 3, 1);
assertThat(new AtomicLongArray(new long[] { 1, 1, 2 })).containsOnly(1, 2);

// assertions will fail
assertThat(atomicLongArray).containsOnly(1, 2, 3, 4);
assertThat(atomicLongArray).containsOnly(4, 7);
Parameters
values:long[]

the given values.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
NullPointerException:
if the given argument is null.
IllegalArgumentException:
if the given argument is an empty array.
AssertionError:
  • if the actual atomic array is null.
  • if the actual atomic array does not contain the given values, i.e. it contains a subset of of the given values, or more values than the given ones.
Since
2.7.0 / 3.7.0
containsOnlyOnceback to summary
public AtomicLongArrayAssert containsOnlyOnce(long... values)

Verifies that the actual atomic array contains the given values only once.

Examples :

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).containsOnlyOnce(1, 2);

// assertions will fail
assertThat(atomicLongArray).containsOnlyOnce(4);
assertThat(new AtomicLongArray(new long[] { 1, 2, 1 })).containsOnlyOnce(1);
assertThat(new AtomicLongArray(new long[] { 1, 2, 3, 3 })).containsOnlyOnce(1, 2, 3);
Parameters
values:long[]

the given values.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
NullPointerException:
if the given argument is null.
IllegalArgumentException:
if the given argument is an empty array.
AssertionError:
  • if the actual atomic array is null.
  • if the actual AtomicLongArray does not contain the given values or contains them more than once.
Since
2.7.0 / 3.7.0
containsSequenceback to summary
public AtomicLongArrayAssert containsSequence(long... sequence)

Verifies that the actual atomic array contains the given sequence, without any other values between them.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).containsSequence(1, 2);

// assertion will fail
assertThat(atomicLongArray).containsSequence(1, 3);
assertThat(atomicLongArray).containsSequence(2, 1);
Parameters
sequence:long[]

the sequence of values to look for.

Returns:AtomicLongArrayAssert

myself assertion object.

Exceptions
AssertionError:
  • if the actual atomic array is null.
  • if the given array is null.
  • if the actual atomic array does not contain the given sequence.
Since
2.7.0 / 3.7.0
containsSubsequenceback to summary
public AtomicLongArrayAssert containsSubsequence(long... subsequence)

Verifies that the actual atomic array contains the given subsequence (possibly with other values between them).

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertions will pass
assertThat(atomicLongArray).containsSubsequence(1, 2)
                           .containsSubsequence(1, 3);

// assertion will fail
assertThat(atomicLongArray).containsSubsequence(2, 1);
Parameters
subsequence:long[]

the subsequence of values to look for.

Returns:AtomicLongArrayAssert

myself assertion object.

Exceptions
AssertionError:
  • if the actual atomic array is null.
  • if the given array is null.
  • if the actual atomic array does not contain the given subsequence.
Since
2.7.0 / 3.7.0
doesNotContainback to summary
public AtomicLongArrayAssert doesNotContain(long... values)

Verifies that the actual atomic array does not contain the given values.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).doesNotContain(4);

// assertion will fail
assertThat(atomicLongArray).doesNotContain(2);
Parameters
values:long[]

the given values.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
NullPointerException:
if the given argument is null.
IllegalArgumentException:
if the given argument is an empty array.
AssertionError:
  • if the actual atomic array is null.
  • if the actual atomic array contains any of the given values.
Since
2.7.0 / 3.7.0
doesNotContainback to summary
public AtomicLongArrayAssert doesNotContain(long value, Index index)

Verifies that the actual atomic array does not contain the given value at the given index.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertions will pass
assertThat(atomicLongArray).doesNotContain(1, atIndex(1))
                           .doesNotContain(2, atIndex(0));

// assertions will fail
assertThat(atomicLongArray).doesNotContain(1, atIndex(0));
assertThat(atomicLongArray).doesNotContain(2, atIndex(1));
Parameters
value:long

the value to look for.

index:Index

the index where the value should be stored in the actual atomic array.

Returns:AtomicLongArrayAssert

myself assertion object.

Exceptions
AssertionError:
  • if the actual atomic array is null.
  • if the actual atomic array contains the given value at the given index.
NullPointerException:
if the given Index is null.
Since
2.7.0 / 3.7.0
doesNotHaveDuplicatesback to summary
public AtomicLongArrayAssert doesNotHaveDuplicates()

Verifies that the actual atomic array does not contain duplicates.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).doesNotHaveDuplicates();

// assertion will fail
assertThat(new AtomicLongArray(new long[] { 1, 1, 2, 3 })).doesNotHaveDuplicates();
Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
AssertionError:
  • if the actual atomic array is null.
  • if the actual atomic array contains duplicates.
Since
2.7.0 / 3.7.0
endsWithback to summary
public AtomicLongArrayAssert endsWith(long... sequence)

Verifies that the actual atomic array ends with the given sequence of values, without any other values between them. Similar to containsSequence(long...), but it also verifies that the last element in the sequence is also last element of the actual atomic array.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).endsWith(2, 3);

// assertion will fail
assertThat(atomicLongArray).endsWith(3, 4);
Parameters
sequence:long[]

the sequence of values to look for.

Returns:AtomicLongArrayAssert

myself assertion object.

Exceptions
NullPointerException:
if the given argument is null.
IllegalArgumentException:
if the given argument is an empty array.
AssertionError:
  • if the actual atomic array is null.
  • if the actual atomic array does not end with the given sequence.
Since
2.7.0 / 3.7.0
hasArrayback to summary
public AtomicLongArrayAssert hasArray(long[] expected)

Verifies that the AtomicLongArray has the given array.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).hasArray(new long[] { 1, 2, 3 });

// assertion will fail
assertThat(atomicLongArray).hasArray(new long[] { 2, 3, 4 });
Parameters
expected:long[]

the long[] array expected to be in the actual AtomicLongArray.

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
AssertionError:
if the AtomicLongArray does not have the given array.
Since
2.7.0 / 3.7.0
hasSameSizeAsback to summary
public AtomicLongArrayAssert hasSameSizeAs(Iterable<?> other)

Implements org.assertj.core.api.EnumerableAssert.hasSameSizeAs.

Verifies that the AtomicLongArray has the same size as given Iterable.

Example:

 Iterable<String> abc = newArrayList("a", "b", "c");
AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).hasSameSizeAs(abc);

// assertions will fail
assertThat(atomicLongArray).hasSameSizeAs(Arrays.asList(1, 2));
assertThat(atomicLongArray).hasSameSizeAs(Arrays.asList(1, 2, 3, 4));
Parameters
other:Iterable<?>

the Iterable to compare size with actual AtomicLongArray.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
  • if the actual AtomicLongArray is null.
  • if the other Iterable is null.
  • if actual AtomicLongArray and given Iterable don't have the same size.
Since
2.7.0 / 3.7.0
hasSizeback to summary
public AtomicLongArrayAssert hasSize(int expected)

Implements org.assertj.core.api.EnumerableAssert.hasSize.

Verifies that the number of values in the AtomicLongArray is equal to the given one.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

assertThat(atomicLongArray).hasSize(3);

// assertion will fail
assertThat(atomicLongArray).hasSize(1);
Parameters
expected:int

the expected number of values in the actual AtomicLongArray.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
if the number of values of the AtomicLongArray is not equal to the given one.
Since
2.7.0 / 3.7.0
hasSizeBetweenback to summary
public AtomicLongArrayAssert hasSizeBetween(int lowerBoundary, int higherBoundary)

Implements org.assertj.core.api.EnumerableAssert.hasSizeBetween.

Verifies that the number of values in the actual array is between the given boundaries (inclusive).

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).hasSizeBetween(3, 4);

// assertion will fail
assertThat(atomicLongArray).hasSizeBetween(4, 6);
Parameters
lowerBoundary:int

the lower boundary compared to which actual size should be greater than or equal to.

higherBoundary:int

the higher boundary compared to which actual size should be less than or equal to.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
if the number of values of the actual array is not between the boundaries.
Since
3.12.0
hasSizeGreaterThanback to summary
public AtomicLongArrayAssert hasSizeGreaterThan(int boundary)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThan.

Verifies that the number of values in the actual array is greater than the given boundary.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).hasSizeGreaterThan(1);

// assertion will fail
assertThat(atomicLongArray).hasSizeGreaterThan(3);
Parameters
boundary:int

the given value to compare the actual size to.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
if the number of values of the actual array is not greater than the boundary.
Since
3.12.0
hasSizeGreaterThanOrEqualToback to summary
public AtomicLongArrayAssert hasSizeGreaterThanOrEqualTo(int boundary)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThanOrEqualTo.

Verifies that the number of values in the actual array is greater than or equal to the given boundary.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).hasSizeGreaterThanOrEqualTo(3);

// assertion will fail
assertThat(atomicLongArray).hasSizeGreaterThanOrEqualTo(5);
Parameters
boundary:int

the given value to compare the actual size to.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
if the number of values of the actual array is not greater than or equal to the boundary.
Since
3.12.0
hasSizeLessThanback to summary
public AtomicLongArrayAssert hasSizeLessThan(int boundary)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThan.

Verifies that the number of values in the actual array is less than the given boundary.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).hasSizeLessThan(4);

// assertion will fail
assertThat(atomicLongArray).hasSizeLessThan(2);
Parameters
boundary:int

the given value to compare the actual size to.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
if the number of values of the actual array is not less than the boundary.
Since
3.12.0
hasSizeLessThanOrEqualToback to summary
public AtomicLongArrayAssert hasSizeLessThanOrEqualTo(int boundary)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThanOrEqualTo.

Verifies that the number of values in the actual array is less than or equal to the given boundary.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).hasSizeLessThanOrEqualTo(3);

// assertion will fail
assertThat(atomicLongArray).hasSizeLessThanOrEqualTo(2);
Parameters
boundary:int

the given value to compare the actual size to.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
if the number of values of the actual array is not less than or equal to the boundary.
Since
3.12.0
isEmptyback to summary
public void isEmpty()

Implements org.assertj.core.api.EnumerableAssert.isEmpty.

Verifies that the AtomicLongArray is empty.

Example:

 // assertion will pass
assertThat(new AtomicLongArray(new long[0])).isEmpty();

// assertion will fail
assertThat(new AtomicLongArray(new long[] { 1, 2, 3 })).isEmpty();
Annotations
@Override
Exceptions
AssertionError:
if the AtomicLongArray is not empty.
Since
2.7.0 / 3.7.0
isNotEmptyback to summary
public AtomicLongArrayAssert isNotEmpty()

Implements org.assertj.core.api.EnumerableAssert.isNotEmpty.

Verifies that the AtomicLongArray is not empty.

Example:

 // assertion will pass
assertThat(new AtomicLongArray(new long[] { 1, 2, 3 })).isNotEmpty();

// assertion will fail
assertThat(new AtomicLongArray(new long[0])).isNotEmpty();
Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
if the AtomicLongArray is empty.
Since
2.7.0 / 3.7.0
isNullOrEmptyback to summary
public void isNullOrEmpty()

Implements org.assertj.core.api.EnumerableAssert.isNullOrEmpty.

Verifies that the AtomicLongArray is null or empty.

Example:

 // assertions will pass
assertThat(new AtomicLongArray(new long[0])).isNullOrEmpty();
AtomicLongArray array = null;
assertThat(array).isNullOrEmpty();

// assertion will fail
assertThat(new AtomicLongArray(new long[] { 1, 2, 3 })).isNullOrEmpty();
Annotations
@Override
Exceptions
AssertionError:
if the AtomicLongArray is not null or not empty.
Since
2.7.0 / 3.7.0
isSortedback to summary
public AtomicLongArrayAssert isSorted()

Verifies that the actual AtomicLongArray is sorted in ascending order according to the natural ordering of its elements.

Empty or one element arrays are considered sorted (unless the array element type is not Comparable).

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
AssertionError:
  • if the actual AtomicLongArray is not sorted in ascending order according to the natural ordering of its elements.
  • if the actual AtomicLongArray is null.
isSortedAccordingToback to summary
public AtomicLongArrayAssert isSortedAccordingTo(Comparator<? super Long> comparator)

Verifies that the actual AtomicLongArray is sorted according to the given comparator.
Empty arrays are considered sorted whatever the comparator is.
One element arrays are considered sorted if the element is compatible with comparator, otherwise an AssertionError is thrown.

Parameters
comparator:Comparator<? super Long>

the Comparator used to compare array elements

Returns:AtomicLongArrayAssert

this assertion object.

Exceptions
AssertionError:
  • if the actual AtomicLongArray is not sorted according to the given comparator.
  • if the actual AtomicLongArray is null.
NullPointerException:
if the given comparator is null.
startsWithback to summary
public AtomicLongArrayAssert startsWith(long... sequence)

Verifies that the actual atomic array starts with the given sequence of values, without any other values between them. Similar to containsSequence(long...), but it also verifies that the first element in the sequence is also first element of the actual atomic array.

Example:

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// assertion will pass
assertThat(atomicLongArray).startsWith(1, 2);

// assertion will fail
assertThat(atomicLongArray).startsWith(2, 3);
Parameters
sequence:long[]

the sequence of values to look for.

Returns:AtomicLongArrayAssert

myself assertion object.

Exceptions
NullPointerException:
if the given argument is null.
IllegalArgumentException:
if the given argument is an empty array.
AssertionError:
  • if the actual atomic array is null.
  • if the actual atomic array does not start with the given sequence.
Since
2.7.0 / 3.7.0
usingDefaultElementComparatorback to summary
public AtomicLongArrayAssert usingDefaultElementComparator()

Implements org.assertj.core.api.EnumerableAssert.usingDefaultElementComparator.

Doc from org.assertj.core.api.EnumerableAssert.usingDefaultElementComparator.

Revert to standard comparison for incoming assertion group element checks.

This method should be used to disable a custom comparison strategy set by calling usingElementComparator(Comparator).

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
usingElementComparatorback to summary
public AtomicLongArrayAssert usingElementComparator(Comparator<? super Long> customComparator)

Implements org.assertj.core.api.EnumerableAssert.usingElementComparator.

Use given custom comparator instead of relying on Long equals method to compare elements for incoming assertion checks.

Custom comparator is bound to the current assertion instance, meaning that if a new assertion is created, it will use default comparison strategy.

Examples :

 AtomicLongArray atomicLongArray = new AtomicLongArray(new long[] { 1, 2, 3 });

// absolute value comparator
Comparator<Long> absComparator = ...;
assertThat(invoiceList).usingComparator(absComparator).contains(-1, -2, 3);
Parameters
customComparator:Comparator<? super Long>

the comparator to use for incoming assertion checks.

Returns:AtomicLongArrayAssert

this assertion object.

Annotations
@Override
@CheckReturnValue
Exceptions
NullPointerException:
if the given comparator is null.