Skip to content

Instantly share code, notes, and snippets.

View chrisvasqm's full-sized avatar

Christian Vasquez chrisvasqm

View GitHub Profile
@chrisvasqm
chrisvasqm / Shapes.java
Last active April 23, 2024 00:14
Shapes exercise
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
var shapes = Arrays.asList(
new Circle(3),
new Rectangle(5, 10),
new Square(5)
);
@chrisvasqm
chrisvasqm / APIClient.java
Created March 26, 2024 03:29
API Testing with Java + RestAssured + TestNG + Truth
package org.example.services;
import io.restassured.RestAssured;
import java.util.List;
public class APIClient<T> {
private final Class<T> type;
private final String baseUrl;
private final String endpoint;
@chrisvasqm
chrisvasqm / EXERCISE-1.md
Last active April 21, 2024 01:22
Object-Oriented Programming Exercises

Stopwatch Exercise

Design a class that represents a Stopwatch. We want to be able to start and stop it. There's no need to track the time that has passed between a start and stop action.

But we should be able to tell the consumer of this class whenever the Stopwatch has started, is already running, stopped and is already stopped on the console.

You should be able to generate this output on the console: