Skip to content
Create a gist now

Instantly share code, notes, and snippets.

public class ProductBuilder {
private double price;
private String name;
public static ProductBuilder aProduct() {
return new ProductBuilder();
public ProductBuilder costing (double price) {
this.price = price;
return this;
public ProductBuilder named(String name) { = name;
return this;
public Product build() {
Product product = new Product();
return product;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.