Skip to content

Instantly share code, notes, and snippets.

import kotlinx.serialization.Serializable
@Serializable
data class DeviceUsed(
val manufacturer: String?,
val deviceName: String?,
val thumbnailUrl: String?,
val imageUrl: String?
)
@rsetkus
rsetkus / SuperHeroesViewModelTest.kt
Last active October 13, 2018 14:36
InstantTaskExecutorRule
class SuperHeroesViewModelTest {
@get:Rule
val instantTaskExecutorRule = InstantTaskExecutorRule()
private val superHeroesRepository = mockk<SuperHeroesRepository>()
private lateinit var superHeroesViewModel: SuperHeroesViewModel
private val listOfSuperHeroes = listOf(SuperHero("Iron Man"), SuperHero("Hulk"))
private val successfulSuperHeroesResult = Result.Success(listOfSuperHeroes)
@rsetkus
rsetkus / item2.java
Created June 21, 2017 15:18
Builder Pattern (Item 2)
// Builder Pattern
public class NutritionFacts {
private final int servingSize;
private final int servings;
private final int calories;
private final int fat;
private final int sodium;
private final int carbohydrate;
public static class Builder {