Created
April 17, 2025 13:03
-
-
Save Amberlamps/f4f7b34616cb6b003855713ecae76902 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
class Claim { | |
String id; | |
int amount; | |
public Claim(String id, int amount) { | |
this.id = id; | |
this.amount = amount; | |
} | |
} | |
class Insurer { | |
String id; | |
int balance; | |
public Insurer(String id, int balance) { | |
this.id = id; | |
this.balance = balance; | |
} | |
} | |
class PayoutTransaction { | |
String claimId; | |
String insurerId; | |
int amount; | |
public PayoutTransaction(String claimId, String insurerId, int amount) { | |
this.claimId = claimId; | |
this.insurerId = insurerId; | |
this.amount = amount; | |
} | |
} | |
public class Main { | |
public static void main(String[] args) { | |
List<Claim> claims = new ArrayList<>(); | |
claims.add(new Claim("a", 100)); | |
claims.add(new Claim("b", 50)); | |
claims.add(new Claim("c", 40)); | |
claims.add(new Claim("d", 60)); | |
claims.add(new Claim("e", 20)); | |
claims.add(new Claim("f", 90)); | |
claims.add(new Claim("g", 120)); | |
claims.add(new Claim("h", 30)); | |
List<Insurer> insurers = new ArrayList<>(); | |
insurers.add(new Insurer("A", 250)); | |
insurers.add(new Insurer("B", 250)); | |
insurers.add(new Insurer("C", 100)); | |
// Optional: print to verify | |
for (Claim claim : claims) { | |
System.out.println("Claim: " + claim.id + ", Amount: " + claim.amount); | |
} | |
for (Insurer insurer : insurers) { | |
System.out.println("Insurer: " + insurer.id + ", Balance: " + insurer.balance); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment