This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.transform.Canonical | |
import spock.lang.Specification | |
class DemoPowerAssertionWorkarounds extends Specification { | |
def val1 = new Outer(new Inner("don't duplicate this output", "or this output")) | |
def val2 = new Outer(new Inner("don't duplicate this output", "this won't match")) | |
def "default power assert"() { | |
expect: | |
val1.inner.b == val2.inner.b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> Task :outgoingVariants | |
-------------------------------------------------- | |
Variant runtimeElements | |
-------------------------------------------------- | |
Elements of runtime for main. | |
Capabilities | |
- org.test:extra:1.0 | |
- org.test:other:3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> Task :outgoingVariants | |
-------------------------------------------------- | |
Variant runtimeElements | |
-------------------------------------------------- | |
Elements of runtime for main. | |
Capabilities | |
- org.test:extra:1.0 | |
- org.test:other:3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomtresansky.interview; | |
import java.util.ArrayList; | |
import java.util.List; | |
class ImmutableCar1 { | |
private String driver; | |
public ImmutableCar1(String p_driver) { | |
driver = p_driver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomtresansky.interview; | |
import java.util.*; | |
import java.util.stream.Collectors; | |
interface Reverser { | |
/** | |
* Return a new list which contains all the elements in the original list greater than 10, in reversed order. | |
* <p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomtresansky.interview; | |
import java.util.*; | |
public class NullPointerThrower { | |
public List<String> getFirstFewBooksWhereFirstWordIsCharactorName(List<Book> p_books) { | |
List<String> passingBooks = new ArrayList<>(); | |
for (int i = 0; i < p_books.size(); i++) { | |
Book currentBook = p_books.get(i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomtresansky.interview; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public final class AddressHelper { | |
/** | |
* Giving an ArrayList of Addresses, extract the Street if the City is a match. Don't | |
* worry about checking Nation. Might not work for nulls? |