Skip to content

Instantly share code, notes, and snippets.

View tresat's full-sized avatar

Tom Tresansky tresat

  • Gradle, Inc
  • Albany, NY
  • 22:09 (UTC -04:00)
View GitHub Profile
@tresat
tresat / DemoPowerAssertionWorkarounds.groovy.groovy
Last active May 4, 2022 14:18
Demonstrate power assertions
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
> Task :outgoingVariants
--------------------------------------------------
Variant runtimeElements
--------------------------------------------------
Elements of runtime for main.
Capabilities
- org.test:extra:1.0
- org.test:other:3.0
@tresat
tresat / previous-output.txt
Created May 4, 2022 12:38
Previous Output
> Task :outgoingVariants
--------------------------------------------------
Variant runtimeElements
--------------------------------------------------
Elements of runtime for main.
Capabilities
- org.test:extra:1.0
- org.test:other:3.0
@tresat
tresat / ImmutableCars.java
Last active May 9, 2019 15:59
Question 4
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;
@tresat
tresat / ListReverser.java
Last active May 9, 2019 15:15
Question 3
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>
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);
@tresat
tresat / AddressHelper.java
Last active May 9, 2019 13:46
Question 1
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?