### Question:
TerrapinUtil { public static Pair<String, Integer> getResourceAndPartitionNum(String helixPartition) { Pair<String, Integer> nonBucketizedResourceAndPartitionNum = getNonBucketizedResourceAndPartitionNum(helixPartition); if (nonBucketizedResourceAndPartitionNum != null) { return nonBucketizedResourceAndPartitionNum; } return getBucketizedResourceAndPartitionNum(helixPartition); }  static String getHelixInstanceFromHDFSHost(String hdfsHostName); static PropertiesConfiguration readPropertiesExitOnFailure(String configFile); static Integer extractPartitionName(String fileName, PartitionerType partitioner); static String formatPartitionName(int partitionNumber); static String getPartitionName(ByteBuffer key,
                                        PartitionerType partitionerType,
                                        int numPartitions); static String hdfsDirToHelixResource(String hdfsDir); static String helixResourceToHdfsDir(String helixResource); static ZooKeeperClient getZooKeeperClient(String zkQuorum, int sessionTimeoutSeconds); static int getBucketSize(int numPartitions, boolean enableZkCompression); static String extractFileSetFromPath(String resource); static Pair<String, Integer> getBucketizedResourceAndPartitionNum(String helixPartition); static Pair<String, Integer> getNonBucketizedResourceAndPartitionNum(
      String helixPartition); static Pair<String, Integer> getResourceAndPartitionNum(String helixPartition); static String getViewPartitionName(String resource, int partition); static int getViewPartitionNumber(String viewPartitionName); static void compressIdealState(IdealState is); static String getZKQuorumFromConf(PropertiesConfiguration configuration); static List<HdfsFileStatus> getHdfsFileList(DFSClient hdfsClient,
                                                     String hdfsDir); static void loadFileSetData(ZooKeeperManager zkManager, FileSetInfo fsInfo, Options options); static List<Pair<Path, Long>> getS3FileList(AWSCredentials credentials,
      String s3Bucket, String s3KeyPrefix); static void setupConfiguration(Configuration conf,
                                        long dfsBlockSize,
                                        int dfsReplication);  }### Answer:
@Test public void testGetResourceAndPartitionNum() { assertEquals(new ImmutablePair("$terrapin$data$file_set$1343443323", 100), TerrapinUtil.getResourceAndPartitionNum("$terrapin$data$file_set$1343443323$100")); assertEquals(new ImmutablePair("$terrapin$data$file_set$1343443323", 100), TerrapinUtil.getResourceAndPartitionNum("$terrapin$data$file_set$1343443323_100")); Assert.assertNull( TerrapinUtil.getResourceAndPartitionNum("$terrapin$data$file_set$1343443323_1r0")); Assert.assertNull( TerrapinUtil.getResourceAndPartitionNum("$terrapin$data$file_set$1343443323$1r0")); Assert.assertNull(TerrapinUtil.getResourceAndPartitionNum("WrongPartition")); }