Skip to content

Instantly share code, notes, and snippets.

View Chesteer89's full-sized avatar

Marcin Środa Chesteer89

View GitHub Profile
data class Tree<T>(var value: T) {
var left: Tree<T>? = null
var right: Tree<T>? = null
}
fun constructSumTree(tree: Tree<Int>?): Tree<Int>? {
if(tree == null) return null
reduceLeafs(tree)
return tree
class KToast : BaseActions, TextViewAssertions {
private val builder = ViewBuilder().apply( {withAnyText()} )
val matcher = this.builder.getViewMatcher()
override val view = this.builder.getViewInteraction().inRoot(ToastMatcher())
/**
* Operator that allows usage of DSL style
*
* @param function Tail lambda with receiver which is your view
@Chesteer89
Chesteer89 / KListPopupWindow
Created October 19, 2017 08:40
KListPopupWindow
class KListPopupWindow(itemTypeBuilder: KAdapterItemTypeBuilder.() -> Unit)
: ListActions, BaseAssertions {
private val builder = ViewBuilder().apply({ withClassName(StringContains(ListView::class.simpleName)) })
val matcher = this.builder.getViewMatcher()
val itemTypes = KAdapterItemTypeBuilder().apply(itemTypeBuilder).itemTypes
override val view = this.builder.getViewInteraction().inRoot(RootMatchers.isPlatformPopup())
/**