Oleh Baibula

Results 12 issues of Oleh Baibula

The broken code: ``` public static boolean hasDuplicates(List entities, T targetEntity) { return entities.stream() .map(BaseEntity::getUuid) .distinct() .count() != entities.size(); } ``` This code doesn't check if the target entity is...

The corrupted code: ``` @Override public boolean contains(T element) { requireNonNull(element); Node current = head; if(!isEmpty()){ while (current.next != null){ if (current.element.equals(element)){ return true; } current = current.next; } }...

The next broken code is accepted: ``` @Override public T remove(int index) { checkIndex(index, size); if (index == 0) { return removeHead(); } else if (index == size - 1)...

The broken code: ``` private void addAsHead(Node newNode) { newNode.next = head; head = newNode; } ``` Please consider the following example: ``` LinkedList list = new LinkedList(); list.add(0, 100);...

It seems that the task description or test may be incorrect or unclear. The regular expression "\b(\w+)\s\1\b" matches two consecutive instances of the same word separated by a single whitespace...

I refer to the findLastWord() and findFirstWord() methods. If you add the string " ........." to the end of the note.txt file like this, the regex from the branch "completed"...

The accepted corrupted code: ``` @SuppressWarnings("unchecked") public void resizeTable(int newCapacity) { Node[] newTable = new Node[newCapacity]; for (int i = 0; i < table.length; i++){ int newIndex = calculateIndex(table[i], newCapacity);...

The containsValues()'s tests accept this wrong solution. This solution doesn't work if in the bucket's element are more than one Node. `@Override public boolean containsValue(V value) { return Arrays.stream(table) .filter(Objects::nonNull)...

The following code is not accepted by 24-th test in ArrayListTest. But this code works just fine. ``` @Override @SuppressWarnings("unchecked") public T remove(int index) { Objects.checkIndex(index, size); T removedElement =...

Hello. The test does not fail with this corrupted code: ``` @Override public void add(T element) { Objects.requireNonNull(element); if (elements.length != size) { elements[size] = element; } else { Object[]...